MATLAB won't plot my graph

1 回表示 (過去 30 日間)
Matthew Orsie
Matthew Orsie 2017 年 11 月 13 日
コメント済み: Matthew Orsie 2017 年 11 月 13 日
%Forced Vibration Project 3.2
%Define values
omeganought = 1.1;
m = 0.3;
F = 0.5;
t = linspace(0, 2*pi / ( abs(omeganought - omega) / 2 ), 250 );
%Predefine Consant
Constant = ( F / (2*m*omeganought) );
%Lines and Curves
FA = Constant * t;
FB = (-1) * Constant * t;
FC = Constant * t * sin( omeganought * t );
%Plotting the graphs
Plot (t,FA,t,FB,t,FC);
This is a Script I wrote to plot a graph on MATLAB. I don't know what I'm doing at all and I basically just copied the same format that my friend used for a different graph on the same project. Can anyone explain what I did wrong here? Thanks

採用された回答

the cyclist
the cyclist 2017 年 11 月 13 日
編集済み: the cyclist 2017 年 11 月 13 日
Please paste in the entire error message you get (i.e. everything from the command window that is in red font).
I can see three errors:
  1. You have not defined the variable omega.
  2. You tried to use the command "Plot" rather than "plot". MATLAB is case sensitive.
  3. You need to use .* rather than * to multiply the vectors in the definition of FC.
When I fix those things (with some arbitrary value for omega), I get output.
  1 件のコメント
Matthew Orsie
Matthew Orsie 2017 年 11 月 13 日
YES! it worked thank you so much

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by