using text in if/else statements
Show older comments
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 Comment
Azzi Abdelmalek
on 4 Aug 2012
you have to use a cell array
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!