Error using * (Inner matrix dimensions must agree)
Ältere Kommentare anzeigen
This is what I have so far
if true
clear all;
clc;
close all;
t=(-.5:1*exp(-6):2);
f=6*exp(-1.5*t)*cos(8*3.14*t);
F=input('Enter a particular value for f(t): ');
Figure 1;
Plot (f,t,'r',F,t,'g');
grid on;
hold on;
end
I know my problem is at the f= line, what am I doing wrong with the *? Thanks
Akzeptierte Antwort
Weitere Antworten (3)
Dan
am 25 Nov. 2013
1 Stimme
Matt J
am 25 Nov. 2013
f=6*exp(-1.5*t).*cos(8*3.14*t);
Dan
am 25 Nov. 2013
1 Kommentar
dpb
am 26 Nov. 2013
Not quite...the initialization sets x to the full vector of f so the while will be a vector and if F is > any value at all in f the condition will never evaluate to T.
Is it mandatory to use while? If not, consider what
diff(x>=F)
yields and how one might use something of that nature.
Note that in your sample loop, even if you set
x=f(1);
as the initialization the while doesn't work as you need and even if it did it doesn't find the crossing points.
Kategorien
Mehr zu Signal Operations finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!