From: Jonathan on 23 Mar 2010 15:27 Thank you both for your comments. This helped tremendously. Jon "Matt Fig" <spamanon(a)yahoo.com> wrote in message <hob39o$n84$1(a)fred.mathworks.com>... > Look at the value produced by Beta>0. Now how does an IF statement deal with non-scalar arguments? (HINT: read the help for IF) > > Beta = [52 52 52 52 60 52 40 24 32 44]; > yB = zeros(length(Beta),1); > > > for ii = 1:length(Beta) > if Beta(ii)>0 & Beta(ii)<10 > yB(ii)=1; > elseif Beta(ii)>10 & Beta(ii)<63 > yB(ii)=cos((Beta(ii)-10)*pi/180); > elseif Beta(ii)>63 > yB(ii)=0.63; > end > end > > > > > Is there a FAQ on this one yet? There should be!
First
|
Prev
|
Pages: 1 2 Prev: How to create a controlled load block in Simulink Next: How to plot output of this function? |