Error in if statement

2 visualizaciones (últimos 30 días)
Dev 8080
Dev 8080 el 30 de Abr. de 2020
Respondida: Devika Surendran el 18 de Jun. de 2020
When I am running the code I am getting the error in if statment that the matrix dimensions do not match.I have written the code to find snm of buttrfly curve of sram ie find side of square in a butterfly curve.Please help me.
[a,T,aT]=xlsread('C:\Users\De80\Desktop\inverterA.csv')
t=a(:,1);y=a(:,2);
[b,bT,bT]=xlsread('C:\Users\De80\Desktop\inverterB.csv')
s=b(:,1);r=b(:,2);
[th, q] = cart2pol(t, y);
[nx, ny] = pol2cart(th+pi/4, q);
[th_1, r_1] = cart2pol(s, r);
[nx_1, ny_1] = pol2cart(th_1+pi/4, r_1);
plot(nx,ny,'red')
hold on
axis square;plot(nx_1,ny_1,'red')
[xi,yi]=polyxpoly(nx,ny,nx_1,ny_1)
if((nx_1)<(xi))
z1=abs(ny-ny_1);
c1=max(z1)
d1=c1.*(1.414);
end
if((nx_1)>(xi))
z2=abs(ny-ny_1);
c2=max(z1)
d2=c1.*(1.414);
end
d=min(d1,d2)
disp(d)

Respuesta aceptada

Devika Surendran
Devika Surendran el 18 de Jun. de 2020
Inside the if statement, in the values compared one is a matrix and the other is a single value. For more information please refer to the below answer as well:

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by