how to open an array?

How could I open a cell array? There is 1X3 structs array
plot type which has 3 ansers
and properties has 3 field too
I need to write a function with two input vector which will plot it with all 3 plot type with their properties.

1 个评论

Please post the entire assignment, and what you have doe so far. Then ask specific questions about the problems you are having with your code and we can help you.

请先登录,再进行评论。

回答(1 个)

S = struct ;
for i = 1:3
S(i).answer = rand(1,3) ;
S(i).field = 1:3 ;
end
% plot
A = cell2mat({S.answer}')' ;
F = cell2mat({S.field}')' ;
plot(F,A)

类别

帮助中心File Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

提问:

2018-12-4

回答:

2018-12-5

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by