Error in if statement
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dev 8080
le 30 Avr 2020
Réponse apportée : Devika Surendran
le 18 Juin 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)
Réponse acceptée
Devika Surendran
le 18 Juin 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:
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!