complex sine graph plotting I need help

1 回表示 (過去 30 日間)
Osita Onyejekwe
Osita Onyejekwe 2016 年 7 月 22 日
コメント済み: Star Strider 2016 年 7 月 22 日
my complex sine graph is 1050 points. I want it to be just 100 points for some other math calculations. here is the function. can someone please fix it for me so that stpFunc is 100 instead of 1050 and still graphs similarly, thanks a ton!
n = 1050;
w = [0:.005:1-0.005]';
w=repmat(w,5,1); %repmat(w,10,1);
w=[zeros(50,1);w];
t=[zeros(50,1)];
for i=1:5 %10
t=[t;i*ones(200,1)];
end
stpFunc = sin(2*pi*w.*t);
complex_sine = stpFunc'
figure; plot(stpFunc,'linewidth',3);
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 7 月 22 日
編集済み: Azzi Abdelmalek 2016 年 7 月 22 日
Can you explain what your code is doing?
Osita Onyejekwe
Osita Onyejekwe 2016 年 7 月 22 日
if you copy and paste it into the command window, it is just a sine graph that looks cool. if you say length(stpFunc) it says 1050, i just want it to be reduced to 100 so that i can put it into a a matrix of other signals i am working on

サインインしてコメントする。

回答 (2 件)

Star Strider
Star Strider 2016 年 7 月 22 日
I do not understand everything you are doing. If you want ‘w’ to have a length of 100, use the linspace function:
w = linspace(0, 1, 100);
I cannot follow what you are doing with the rest of your code, so you will have to change it to work with the new ‘w’.
  4 件のコメント
Osita Onyejekwe
Osita Onyejekwe 2016 年 7 月 22 日
thank you so much, this will do!!!
Star Strider
Star Strider 2016 年 7 月 22 日
My pleasure!
If my Answer solved your problem, please Accept it.

サインインしてコメントする。


Osita Onyejekwe
Osita Onyejekwe 2016 年 7 月 22 日
basically i want this entire graph to be in the domain to 100 instead of 1050..im just not sure how to scale it all down..can someone please help me?

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by