Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I AM GETTING FOLLOWING ERROR WHEN I RUN MY CODE ...... Assignment has more non-singleton rhs dimensions than non-singleton subscripts

1 vue (au cours des 30 derniers jours)
D S Parihar
D S Parihar le 11 Sep 2015
Clôturé : MATLAB Answer Bot le 20 Août 2021
a='D:\Seismic Data'
b=dir(fullfile(a));
L1=length(b);
for i=3:L1
c=dir(fullfile(a,b(i).name));
d=fullfile(a,b(i).name,c(7).name);
e=fopen(d);
f=fread(e);
g=char(f);
h=g';
s1(i,1)=[h(361) h(362) h(363)];
s2(i,2)=[h(223) h(224)];
s3(i,3)=[h(249) h(250)];
s4(i,4)=[h(294) h(295)];
s5(i,5)=[h(297) h(298)];
end
  2 commentaires
D S Parihar
D S Parihar le 11 Sep 2015
a='D:\Seismic Data' b=dir(fullfile(a)); L1=length(b); for i=3:L1 c=dir(fullfile(a,b(i).name)); d=fullfile(a,b(i).name,c(7).name); e=fopen(d); f=fread(e); g=char(f); h=g'; s1(i-2,:)=[h(361) h(362) h(363)]; s2(i-2,:)=[h(223) h(224)]; s3(i-2,:)=[h(249) h(250)]; s4(i-2,:)=[h(294) h(295)]; s5(i-2,:)=[h(297) h(298)]; end

Réponses (1)

James Tursa
James Tursa le 11 Sep 2015
How are these lines supposed to work?
s1(i,1)=[h(361) h(362) h(363)];
s2(i,2)=[h(223) h(224)];
s3(i,3)=[h(249) h(250)];
s4(i,4)=[h(294) h(295)];
s5(i,5)=[h(297) h(298)];
It looks like you are doing this:
s1(i,1)= 1 x 3 vector;
s2(i,2)= 1 x 2 vector;
s3(i,3)= 1 x 2 vector;
s4(i,4)= 1 x 2 vector;
s5(i,5)= 1 x 2 vector;
So it looks like you are trying to stuff vectors into scalar elements. What is s1, s2, s3, s4, s5?
  1 commentaire
D S Parihar
D S Parihar le 11 Sep 2015
Modifié(e) : D S Parihar le 11 Sep 2015
THANK YOU JAMES.........i solved it in this way
a='D:\Seismic Data' b=dir(fullfile(a)); L1=length(b); for i=3:L1 c=dir(fullfile(a,b(i).name)); d=fullfile(a,b(i).name,c(7).name); e=fopen(d); f=fread(e); g=char(f); h=g'; s1(i-2,:)=[h(361) h(362) h(363)]; s2(i-2,:)=[h(223) h(224)]; s3(i-2,:)=[h(249) h(250)]; s4(i-2,:)=[h(294) h(295)]; s5(i-2,:)=[h(297) h(298)]; end

Cette question est clôturée.

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by