How do i select a variable for global use from an array?
Ältere Kommentare anzeigen
Hi all, i was wondering how i would take a value which is inside an array and assign a variable to it, for example
i have
D=struct('Coord',Coord','Con',Con','Re',Re','Load',Load','E',E','A',A');
in which all of the inputs are relatively large vectors I want to creat a global variable call A (area) by going into this array and selecting the A from it
I have tried A = D[A] but that does not work in MATLAB
Any ideas? thanks
Antworten (2)
James Tursa
am 26 Feb. 2011
1 Stimme
A = D.A;
But why not just use D.A?
3 Kommentare
David Fraser
am 26 Feb. 2011
Jiro Doke
am 26 Feb. 2011
I strongly suggest going through the "Getting Started" guide in the documentation. It will save you in the long run.
Jan
am 27 Feb. 2011
@David: You can mark this answer as matching your question exctly by choosing it as "accepted".
David Fraser
am 26 Feb. 2011
0 Stimmen
Kategorien
Mehr zu Structures finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!