using text in if/else statements
이전 댓글 표시
this is kind of a silly question. But I am trying to map the parameter space of a set of coupled oscillators storing the phase difference. However, for some parameter values obviously the coupling leads to chaotic behavior. I want to be able to mark those values
I have calculated the phase difference for different parameter values by take the mean of the difference of the values of the two oscillators, and I have stored this information in an array. However, I like to be able to add an if/else statement that would mark values that have a very high standard deviation (or some other condition that would show that the coupling behavior of the oscillators is chaotic for that parameter set). I was thinking of temporarily just having some std value above which the mean would not be stored in the array, but 'chaotic' would be stored. For example:
if std(s([30:700],1)-s([30:700],2))>0.1;
my_data(i,j)=display('chaotic');
else
my_data(i,j)=mean(s([30:700],2)-s([30:700],1))
end
However, this doesn't work. and obviously disp() doesn't work either. Eventually I would like to be able use a function like pcolor to map out parameter space. But I would want to be able to black out the portions that lead to chaotic coupling behavior.
Thanks!
댓글 수: 1
Azzi Abdelmalek
2012년 8월 4일
you have to use a cell array
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!