From: us on
"Florent " <florentdotdieterlen(a)bluewindotch.removethis.partt> wrote in message <i2jp9i$2kl$1(a)fred.mathworks.com>...
> Hi,
> Jan gave me a solution, but it failed, with this error message:
> ??? Undefined function or variable
> 'S_d'.
>
> Error in ==> essai_int2str_jan at 3
> s = load([S_d' int2str(i)
> '.txt']);
>
> I tried also with the former coammand: s=['load S_d' int2str(i) '.txt']
> and it gave me another message:
> ??? Attempt to reference field of
> non-structure array.
>
> Error in ==> essai_int2str_jan_a at
> 6
> f = s.([' S_d' int2str(i)]); %
> See "dynamic field names"
>
> I went on the help, but didn't find the solution.
> Florent

your posting style is messy and confusing...
simply displaying error messages is frustrating...
show CSSM a concise snippet of data and ML code of your input and desired output...

us
From: Florent on
Sorry, the code disappeared. Here it is (S_d1.txt, S_d2.txt, etc. are files containing a matrix:

for i = 1:8
s = load([S_d' int2str(i) '.txt']);
f = s.([' S_d' int2str(i)]); % See "dynamic field names"
size(f)

end
%B = rand(10, 3); % Test data
%save('B', [sprintf('FileName%d.mat', j]);
%s=['load S_d' int2str(i) '.txt']
??? Undefined function or variable
'S_d'.

Error in ==> essai_int2str_jan at 3
s = load([S_d' int2str(i)
'.txt']);


and here is the other try I made:

for i = 1:8
s=['load S_d' int2str(i) '.txt']
f = s.([' S_d' int2str(i)]); % See "dynamic field names"
size(f)
end
%B = rand(10, 3); % Test data
%save('B', [sprintf('FileName%d.mat', j]);
%s=['load S_d' int2str(i) '.txt']
??? Attempt to reference field of
non-structure array.

Error in ==> essai_int2str_jan_a at
6
f = s.([' S_d' int2str(i)]); %
See "dynamic field names"

Please note that I am a beginner.
Thanks in advance,
Florent


"us " <us(a)neurol.unizh.ch> wrote in message <i2jtjm$5v9$1(a)fred.mathworks.com>...
> "Florent " <florentdotdieterlen(a)bluewindotch.removethis.partt> wrote in message <i2jp9i$2kl$1(a)fred.mathworks.com>...
> > Hi,
> > Jan gave me a solution, but it failed, with this error message:
> > ??? Undefined function or variable
> > 'S_d'.
> >
> > Error in ==> essai_int2str_jan at 3
> > s = load([S_d' int2str(i)
> > '.txt']);
> >
> > I tried also with the former coammand: s=['load S_d' int2str(i) '.txt']
> > and it gave me another message:
> > ??? Attempt to reference field of
> > non-structure array.
> >
> > Error in ==> essai_int2str_jan_a at
> > 6
> > f = s.([' S_d' int2str(i)]); %
> > See "dynamic field names"
> >
> > I went on the help, but didn't find the solution.
> > Florent
>
> your posting style is messy and confusing...
> simply displaying error messages is frustrating...
> show CSSM a concise snippet of data and ML code of your input and desired output...
>
> us
From: Andy on
In this line:

s = load([S_d' int2str(i) '.txt']);

did you mean:

s = load(['S_d' int2str(i) '.txt']); % note the extra apostrophe before S_d
First  |  Prev  | 
Pages: 1 2
Prev: about reading the images
Next: NI DAQ for Simulink