Prev: Fitting data and then accessing sse, rsquare, dfe, adjrsquare and rmse values
Next: matrix grouping problem
From: Gonzalo on 28 Jun 2010 16:29 Hi there, Does anybody know how to assign a name to a variable loaded with command "load"? or at to find out which is the name of the variable just loaded? Thanks, G
From: Matt Fig on 28 Jun 2010 16:35 Is this what you have in mind? D = load('clown'); fieldnames(D)
From: Gonzalo on 28 Jun 2010 16:50 "Matt Fig" <spamanon(a)yahoo.com> wrote in message <i0b11o$91e$1(a)fred.mathworks.com>... > Is this what you have in mind? > > D = load('clown'); > fieldnames(D) Thanks Matt. Below is the trick... B = getfield(A,char(fieldnames(A))); Thanks again.
From: Steven Lord on 28 Jun 2010 17:27
"Gonzalo " <glpita(a)gmail.com> wrote in message news:i0b1tv$63n$1(a)fred.mathworks.com... > "Matt Fig" <spamanon(a)yahoo.com> wrote in message > <i0b11o$91e$1(a)fred.mathworks.com>... >> Is this what you have in mind? >> >> D = load('clown'); >> fieldnames(D) > > Thanks Matt. Below is the trick... > > B = getfield(A,char(fieldnames(A))); Why not use dynamic field names? D = load('clown'); fields = fieldnames(D); B = D.(fields{1}); fields{1} whos -file clown whos B -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com |