how do you write a conditional struct?
1 view (last 30 days)
Show older comments
vishant m.
on 18 Nov 2013
Commented: vishant m.
on 18 Nov 2013
how do you write a conditional struct?
Accepted Answer
Walter Roberson
on 18 Nov 2013
At the beginning start with
data = [];
Then, in each of the error cases, after you disp() the string, add
return
before the "end" of the "if"
if condition
disp('message')
return
end
More Answers (1)
Azzi Abdelmalek
on 18 Nov 2013
4 Comments
Azzi Abdelmalek
on 18 Nov 2013
[i need the struct to give ans[] when the condition of any of the ifs applies.] I can't understand what you mean
See Also
Categories
Find more on Structures 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!