App Designer Error: Unable to perform assignment because the left and right sides have a different number of elements.

1 view (last 30 days)
I'm currently trying to adapt this code for a induction motor speed control method to a web app and I keep getting the error in the title, please help
clear all
close all
clc
Vl1=input('Enter the first Suppy Voltage (line to line) RMS value: ');
Vl2=input('Enter the second Suppy Voltage (line to line) RMS value: ');
Vl3=input('Enter the third Suppy Voltage (line to line) RMS value: ');
Vl4=input('Enter the fourth Suppy Voltage (line to line) RMS value: ');
Vl5=input('Enter the fifth Suppy Voltage (line to line) RMS value: ');
P=input('Enter the number of poles: ');
Rs=input('Stator Resistance: ');
Rr=input('Rotor Resistance: ');
Xs=input('Stator Leakage Reactance @ 50 Hz frequecny: ');
Xr=input('Rotor Leakage Reactance @ 50 Hz frequecny: ');
Ls=Xs/(2*pi*50);
Lr=Xr/(2*pi*50);
Wsync1=4*pi*50/P;
m=1;
for Wrotor1=0:0.002:Wsync1
Tmf1(m)=(3*(((Vl1^2)*Rr/((Wsync1-Wrotor1)/Wsync1))/((Rs+Rr/((Wsync1-Wrotor1)/Wsync1))^2+(2*pi*50*Ls+2*pi*50*Lr)^2))/Wsync1); %star connected
m=m+1;
end
m=1;
for Wrotor1=0:0.002:Wsync1
Tmf2(m)=(3*(((Vl2^2)*Rr/((Wsync1-Wrotor1)/Wsync1))/((Rs+Rr/((Wsync1-Wrotor1)/Wsync1))^2+(2*pi*50*Ls+2*pi*50*Lr)^2))/Wsync1);
m=m+1;
end
m=1;
for Wrotor1=0:0.002:Wsync1
Tmf3(m)=(3*(((Vl3^2)*Rr/((Wsync1-Wrotor1)/Wsync1))/((Rs+Rr/((Wsync1-Wrotor1)/Wsync1))^2+(2*pi*50*Ls+2*pi*50*Lr)^2))/Wsync1);
m=m+1;
end
m=1;
for Wrotor1=0:0.002:Wsync1
Tmf4(m)=(3*(((Vl4^2)*Rr/((Wsync1-Wrotor1)/Wsync1))/((Rs+Rr/((Wsync1-Wrotor1)/Wsync1))^2+(2*pi*50*Ls+2*pi*50*Lr)^2))/Wsync1);
m=m+1;
end
m=1;
for Wrotor1=0:0.002:Wsync1
Tmf5(m)=(3*(((Vl5^2)*Rr/((Wsync1-Wrotor1)/Wsync1))/((Rs+Rr/((Wsync1-Wrotor1)/Wsync1))^2+(2*pi*50*Ls+2*pi*50*Lr)^2))/Wsync1);
m=m+1;
end
plot(Tmf1);
hold on;
plot(Tmf2);
plot(Tmf3);
plot(Tmf4);
plot(Tmf5);
hold off;
ylabel('Torque(N-m)');
xlabel('Rotor Speed(Rad/s)');

Answers (1)

Aghamarsh Varanasi
Aghamarsh Varanasi on 22 Apr 2021
Hi,
The script seems to run with out any error for the inputs of type 'double'. Please check if the input from appdesigner is passed as a 'string' to the script, as the default type of input in 'edit field' is 'string'.
Hope this helps

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!