About "=: nonconformant arguments"

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

About "=: nonconformant arguments"

Aziz YÜCELEN
Hi!

I am a newbee to Octave. I have a problem with the error message below.

error: deneme2: =: nonconformant arguments (op1 is 1x1, op2 is 1x0)
  error: called from
  deneme2 at line 77 column 33 "

Error line command is " Right_connector(i+1,2) = u; "

My full code is here, can you please help me?

n=5
s=[2 0;1 1;1 3],
b=[0 -1 0];
center_x=1;
center_y=0;
circle_count=(s(1,1)+s(1,2))/2
Right_connector=zeros(19,4);
Left_connector=zeros(19,4);
connector_index =1;
%first segment
for i=1:circle_count
  radius=i;
  start_left_circle(center_x,center_y,radius)
  if (circle_count==1)
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y+1;  
   
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i+1;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y-1;      
  else
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = circle_count-i+1;
   
    Right_connector((2*circle_count)-i+1,1) = connector_index;
    Right_connector((2*circle_count)-i+1,2) = (2*circle_count)-i+1;
    Right_connector((2*circle_count)-i+1,3) = center_x;
    Right_connector((2*circle_count)-i+1,4) = i-circle_count-1;
 endif
end

for i=1:n-2
    if (b(i)==0)
      if (s(i,1)>0)
        for u=s(i,1):1
          line(i+1,u+circle_count,i+3,circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = u+circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+1;
          Right_connector(i+1,4) = u+circle_count;      
        end
      endif
      if (s(i,2)>0)
        for u=1:s(i,2)
          line(i+1,-u-circle_count,i+3,-u-circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = -u-circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+3;
          Right_connector(i+1,4) = -u-circle_count;      
        end
      endif      
 
 
  endif
    if (b(i)<0)
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
      for p=1:circle_count
          radius=2*p;
          left_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u; <***************** error is here. line 77. 
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
      end
    end  
    if (b(i)>0)
 
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
     
      for p=1:circle_count
          radius=2*p;
          right_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-11;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-1;
          Right_connector(i+1,4) = -p;
      end
    endif
 end




Reply | Threaded
Open this post in threaded view
|

Re: About "=: nonconformant arguments"

Doug Stewart-4


On Wed, Jul 10, 2019 at 8:33 AM Aziz YÜCELEN <[hidden email]> wrote:
Hi!

I am a newbee to Octave. I have a problem with the error message below.

error: deneme2: =: nonconformant arguments (op1 is 1x1, op2 is 1x0)
  error: called from
  deneme2 at line 77 column 33 "

Error line command is " Right_connector(i+1,2) = u; "

My full code is here, can you please help me?

n=5
s=[2 0;1 1;1 3],
b=[0 -1 0];
center_x=1;
center_y=0;
circle_count=(s(1,1)+s(1,2))/2
Right_connector=zeros(19,4);
Left_connector=zeros(19,4);
connector_index =1;
%first segment
for i=1:circle_count
  radius=i;
  start_left_circle(center_x,center_y,radius)


I can't run it because i don't have a 

  start_left_circle(center_x,center_y,radius)

!!!



 
  if (circle_count==1)
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y+1;  
   
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i+1;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y-1;      
  else
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = circle_count-i+1;
   
    Right_connector((2*circle_count)-i+1,1) = connector_index;
    Right_connector((2*circle_count)-i+1,2) = (2*circle_count)-i+1;
    Right_connector((2*circle_count)-i+1,3) = center_x;
    Right_connector((2*circle_count)-i+1,4) = i-circle_count-1;
 endif
end

for i=1:n-2
    if (b(i)==0)
      if (s(i,1)>0)
        for u=s(i,1):1
          line(i+1,u+circle_count,i+3,circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = u+circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+1;
          Right_connector(i+1,4) = u+circle_count;      
        end
      endif
      if (s(i,2)>0)
        for u=1:s(i,2)
          line(i+1,-u-circle_count,i+3,-u-circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = -u-circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+3;
          Right_connector(i+1,4) = -u-circle_count;      
        end
      endif      
 
 
  endif
    if (b(i)<0)
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
      for p=1:circle_count
          radius=2*p;
          left_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u; <***************** error is here. line 77. 
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
      end
    end  
    if (b(i)>0)
 
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
     
      for p=1:circle_count
          radius=2*p;
          right_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-11;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-1;
          Right_connector(i+1,4) = -p;
      end
    endif
 end





--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Ynt: About "=: nonconformant arguments"

Aziz YÜCELEN
I am sorry, I forgot function m files 


function start_left_circle(center_x,center_y,radius)
th = linspace( pi/2, (3*pi)/2, 100);
R = radius/2;  %or whatever radius you want
x = R*cos(th)+center_x;
y = R*sin(th)+center_y;
plot(x,y,'k');
axis equal;
hold on
plot([center_x center_x], [20 -20],'k-.')
hold on
plot([center_x center_x], [center_y center_y],'ko')
hold on
end

function line(x1,y1,x2,y2)
hold on
plot([x1 x2], [y1 y2],'r')
end


function left_circle(center_x,center_y,radius)
th = linspace( pi/2, (3*pi)/2, 100);
R = radius/2;  %or whatever radius you want
x = R*cos(th)+center_x;
y = R*sin(th)+center_y;
plot(x,y,'k');
axis equal;
hold on
plot([center_x center_x], [20 -20],'k-.')
hold on
plot([center_x center_x+1], [center_y+R center_y+R],'k-')
hold on
plot([center_x center_x+1], [-(center_y+R) -(center_y+R)],'k-')
hold on
plot([center_x center_x], [center_y center_y],'ko')
hold on
end


function right_circle(center_x,center_y,radius)
th = linspace( (-pi)/2, pi/2, 100);
R = radius/2;  %or whatever radius you want
x = R*cos(th)+center_x;
y = R*sin(th)+center_y;
plot(x,y,'k');
axis equal;
hold on
plot([center_x center_x], [20 -20],'k-.')
hold on
plot([center_x center_x-1], [center_y+R center_y+R],'k-')
hold on
plot([center_x center_x-1], [-(center_y+R) -(center_y+R)],'k-')
hold on
plot([center_x center_x], [center_y center_y],'ko')
hold on
end








Gönderen: Doug Stewart <[hidden email]>
Gönderildi: 10 Temmuz 2019 Çarşamba 15:58
Kime: Aziz YÜCELEN
Bilgi: [hidden email]
Konu: Re: About "=: nonconformant arguments"
 


On Wed, Jul 10, 2019 at 8:33 AM Aziz YÜCELEN <[hidden email]> wrote:
Hi!

I am a newbee to Octave. I have a problem with the error message below.

error: deneme2: =: nonconformant arguments (op1 is 1x1, op2 is 1x0)
  error: called from
  deneme2 at line 77 column 33 "

Error line command is " Right_connector(i+1,2) = u; "

My full code is here, can you please help me?

n=5
s=[2 0;1 1;1 3],
b=[0 -1 0];
center_x=1;
center_y=0;
circle_count=(s(1,1)+s(1,2))/2
Right_connector=zeros(19,4);
Left_connector=zeros(19,4);
connector_index =1;
%first segment
for i=1:circle_count
  radius=i;
  start_left_circle(center_x,center_y,radius)


I can't run it because i don't have a 

  start_left_circle(center_x,center_y,radius)

!!!



 
  if (circle_count==1)
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y+1;  
   
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i+1;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y-1;      
  else
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = circle_count-i+1;
   
    Right_connector((2*circle_count)-i+1,1) = connector_index;
    Right_connector((2*circle_count)-i+1,2) = (2*circle_count)-i+1;
    Right_connector((2*circle_count)-i+1,3) = center_x;
    Right_connector((2*circle_count)-i+1,4) = i-circle_count-1;
 endif
end

for i=1:n-2
    if (b(i)==0)
      if (s(i,1)>0)
        for u=s(i,1):1
          line(i+1,u+circle_count,i+3,circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = u+circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+1;
          Right_connector(i+1,4) = u+circle_count;      
        end
      endif
      if (s(i,2)>0)
        for u=1:s(i,2)
          line(i+1,-u-circle_count,i+3,-u-circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = -u-circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+3;
          Right_connector(i+1,4) = -u-circle_count;      
        end
      endif      
 
 
  endif
    if (b(i)<0)
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
      for p=1:circle_count
          radius=2*p;
          left_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u; <***************** error is here. line 77. 
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
      end
    end  
    if (b(i)>0)
 
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
     
      for p=1:circle_count
          radius=2*p;
          right_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-11;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-1;
          Right_connector(i+1,4) = -p;
      end
    endif
 end





--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: About "=: nonconformant arguments"

Doug Stewart-4
In reply to this post by Aziz YÜCELEN


On Wed, Jul 10, 2019 at 8:33 AM Aziz YÜCELEN <[hidden email]> wrote:
Hi!

I am a newbee to Octave. I have a problem with the error message below.

error: deneme2: =: nonconformant arguments (op1 is 1x1, op2 is 1x0)
  error: called from
  deneme2 at line 77 column 33 "

Error line command is " Right_connector(i+1,2) = u; "

My full code is here, can you please help me?

n=5
s=[2 0;1 1;1 3],
b=[0 -1 0];
center_x=1;
center_y=0;
circle_count=(s(1,1)+s(1,2))/2
Right_connector=zeros(19,4);
Left_connector=zeros(19,4);
connector_index =1;
%first segment
for i=1:circle_count
  radius=i;
  start_left_circle(center_x,center_y,radius)
  if (circle_count==1)
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y+1;  
   
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i+1;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y-1;      
  else
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = circle_count-i+1;
   
    Right_connector((2*circle_count)-i+1,1) = connector_index;
    Right_connector((2*circle_count)-i+1,2) = (2*circle_count)-i+1;
    Right_connector((2*circle_count)-i+1,3) = center_x;
    Right_connector((2*circle_count)-i+1,4) = i-circle_count-1;
 endif
end

for i=1:n-2
    if (b(i)==0)
      if (s(i,1)>0)
        for u=s(i,1):1
This line looks like a problem
when I run your code s(1,1) is 2 so this is for u =2:1   and this leave u to be [] (blank)

Are you using the GUI and default editor?
If you are then it is easy the set a breakpoint and then step through the code and see what is in each variable.

 
          line(i+1,u+circle_count,i+3,circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = u+circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+1;
          Right_connector(i+1,4) = u+circle_count;      
        end
      endif
      if (s(i,2)>0)
        for u=1:s(i,2)
          line(i+1,-u-circle_count,i+3,-u-circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = -u-circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+3;
          Right_connector(i+1,4) = -u-circle_count;      
        end
      endif      
 
 
  endif
    if (b(i)<0)
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
      for p=1:circle_count
          radius=2*p;
          left_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u; <***************** error is here. line 77. 
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
      end
    end  
    if (b(i)>0)
 
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
     
      for p=1:circle_count
          radius=2*p;
          right_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-11;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-1;
          Right_connector(i+1,4) = -p;
      end
    endif
 end





--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: About "=: nonconformant arguments"

Doug Stewart-4
In reply to this post by Aziz YÜCELEN
OK

On Wed, Jul 10, 2019 at 11:36 AM Aziz YÜCELEN <[hidden email]> wrote:
Yes it works fine . Main problem as you say "u" value.  Thank you doug


From: Doug Stewart <[hidden email]>
Sent: Wednesday, July 10, 2019 6:03:29 PM
To: Aziz YÜCELEN
Subject: Re: About "=: nonconformant arguments"
 
did you get it to work?

On Wed, Jul 10, 2019 at 8:33 AM Aziz YÜCELEN <[hidden email]> wrote:
Hi!

I am a newbee to Octave. I have a problem with the error message below.

error: deneme2: =: nonconformant arguments (op1 is 1x1, op2 is 1x0)
  error: called from
  deneme2 at line 77 column 33 "

Error line command is " Right_connector(i+1,2) = u; "

My full code is here, can you please help me?

n=5
s=[2 0;1 1;1 3],
b=[0 -1 0];
center_x=1;
center_y=0;
circle_count=(s(1,1)+s(1,2))/2
Right_connector=zeros(19,4);
Left_connector=zeros(19,4);
connector_index =1;
%first segment
for i=1:circle_count
  radius=i;
  start_left_circle(center_x,center_y,radius)
  if (circle_count==1)
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y+1;  
   
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i+1;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = center_y-1;      
  else
    Right_connector(i,1) = connector_index;
    Right_connector(i,2) = i;
    Right_connector(i,3) = center_x;
    Right_connector(i,4) = circle_count-i+1;
   
    Right_connector((2*circle_count)-i+1,1) = connector_index;
    Right_connector((2*circle_count)-i+1,2) = (2*circle_count)-i+1;
    Right_connector((2*circle_count)-i+1,3) = center_x;
    Right_connector((2*circle_count)-i+1,4) = i-circle_count-1;
 endif
end

for i=1:n-2
    if (b(i)==0)
      if (s(i,1)>0)
        for u=s(i,1):1
          line(i+1,u+circle_count,i+3,circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = u+circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+1;
          Right_connector(i+1,4) = u+circle_count;      
        end
      endif
      if (s(i,2)>0)
        for u=1:s(i,2)
          line(i+1,-u-circle_count,i+3,-u-circle_count)
          Left_connector(i,1) = i;
          Left_connector(i,2) = u;
          Left_connector(i,3) = i+1;
          Left_connector(i,4) = -u-circle_count;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = i+3;
          Right_connector(i+1,4) = -u-circle_count;      
        end
      endif      
 
 
  endif
    if (b(i)<0)
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
      for p=1:circle_count
          radius=2*p;
          left_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u; <***************** error is here. line 77. 
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = -(3*i)+1;
          Right_connector(i+1,4) = -p;
      end
    end  
    if (b(i)>0)
 
      circle_count=(s(i+1,1)+s(i+1,2))/2;
      center_x=3*i;
     
      for p=1:circle_count
          radius=2*p;
          right_circle(center_x,center_y,radius)
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-11;
          Right_connector(i+1,4) = -p;
         
          Right_connector(i+1,1) = i;
          Right_connector(i+1,2) = u;
          Right_connector(i+1,3) = (3*i)-1;
          Right_connector(i+1,4) = -p;
      end
    endif
 end





--
DASCertificate for 206392



--
DASCertificate for 206392