Nonconformant arguments (HELP)

Hey everyone!
So I was coding this project for school and I was having a problem with my code when trying to calculate the a(i) variable. without the line in question my code runs fine and calculates all the other variables fine but with it only calculates the first two values of each variable and then stops with the following error:

error: EX2: operator /: nonconformant arguments (op1 is 1x1, op2 is 1x2)

I already tried adding a ‘.’ before the division and multiplications but that didnt solve the problem. does anybody have an idea?

Thanks in advance
CODE:

clear all
clc
close all

i=1; 
R=5; #Blade radius
tSR=7; #Tip speed ratio
B=3; #Number of blades
aSP=[36.6,18.5,10.6,6.4,3.8,2,0.7,-0.2,-1,-1.6]; #Section pitch angle (in degrees)

for r =0.5:0.5:5;
  rTable(i)=r; #r for reference
  ratio(i)=r/R; #r/R ratio
  lSR(i)=tSR*ratio(i); #Local speed ratio
  aRW(i)=(2/3)*atand(1/lSR(i)); #Angle of the relative wind
  aA(i)=aRW(i)-aSP(i); #Angle of attack
  
  if (aA(i)>0 && aA(i)<2) #Lift and drag coefficients depending on angle of attack
    lC=0.53; 
    dC=0.007;
  elseif (aA(i)>4 && aA(i)<6) #values between 2 and 4 not needed 
    lC=0.96; 
    dC=0.008;
  else #rest of values lay within the 6-8 range
    lC=1.15; 
    dC=0.0076;
  endif
  
  chord(i)=((8*pi*r)/(B*lC))*(1-cos(aRW(i))); #Chord
  cS=B*chord/2*pi*r; #Chord solidity (local)
  
  a(i)=1/(1+((4*(sind(aRW(i)).^2))/(cS*lC*cosd(aRW(i)))))    <------- THIS LINE
  
  
  i=i+1;
endfor

My system

  • OS: e.g. Windows 10 (version 2004) or Ubuntu 20.04
  • Octave version: e.g. Version 6.1.0
  • Installation method: e.g. Downloaded and installed “octave-6.1.0-w64-installer.exe” from https://www.octave.org/download.html

cS grows with each loop iteration.
Maybe you wanted to write:

cS=B*chord(i)/2*pi*r; #Chord solidity (local)

or:

a(i)=1/(1+((4*(sind(aRW(i)).^2))/(cS(i)*lC*cosd(aRW(i)))));

In cases like this one, it often helps to inspect the dimensions of the variables used in the line that throws the error.

thanks so much the problem was indeed with cS! i fixed it by changing it to this:

cS(i)=B*chord(i)/2*pi*r; #Chord solidity (local)

thanks again