如何用matlab编程计算该组公式的离散点?

如题所述

题主给出的一组公式要求x(i),y(i)值(离散点),通过分析可以按下列思路来实现。

1、根据θ(0~π)的范围,求出

theta=0:pi/20:pi;

n=50;R=5;

U=sqrt(n^2-cos(theta).^2)-sin(theta);

Mx=n-cos(theta);

My=-(U+sin(theta));

2、根据x(end),y(end)值【从后两公式,不难发现,只有已知x(end),y(end)值,才能求x(end-1),y(end-1)值】,用for循环语句求出x(end-1),y(end-1)值,可以用solve函数求解。

3、求出x(i),y(i)值,可以用plot函数绘出θ~x和θ~y曲线图,绘出x~y曲线图

这里取n=50;R=5; 可以得到如下结果


由于题主没有给出具体的已知条件,所以上述根据我的理解假设的。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2019-10-31
clc;clear all;close all;
%sin function
fs=8000;
t=(1:80000)/fs;
y1=4*sin(2*pi*1*t);
subplot(211);
plot(t,y1);
title('Signal');
[counts binValues]=hist(y1,64);%绘制直方图
subplot(212)
bar(binValues,counts);xlim([-8 8]);%绘制直方图
title('Histogram');
grid on;
%Gaussian noise
y2=randn(1,length(t));
figure;
subplot(211);
plot(t,y2);
title('Signal');
[counts binValues]=hist(y2,64);
subplot(212)
bar(binValues,counts);xlim([-8 8]);
title('Histogram');
grid on;
%Plus of the sin and Gussian

figure;
y2=randn(1,length(t));
subplot(211);
plot(t,y1+y2);
title('Signal');
[counts binValues]=hist(y1+y2,64);
subplot(212)
bar(binValues,counts);
xlim([-8 8]);
title('Histogram');
grid on;