Effacer les filtres
Effacer les filtres

how to open an array?

2 vues (au cours des 30 derniers jours)
Dezdi
Dezdi le 4 Déc 2018
Réponse apportée : KSSV le 5 Déc 2018
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 commentaire
James Tursa
James Tursa le 4 Déc 2018
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.

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 5 Déc 2018
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)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by