Filter löschen
Filter löschen

Error in if statement

1 Ansicht (letzte 30 Tage)
Dev 8080
Dev 8080 am 30 Apr. 2020
Beantwortet: Devika Surendran am 18 Jun. 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)

Akzeptierte Antwort

Devika Surendran
Devika Surendran am 18 Jun. 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:

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by