Matrix dimension must agree
Mostrar comentarios más antiguos
Ihave a code
xd=-(sqrt(R²-ho²)):0.5:x3;
xd1=x3;
yd1=y3;
xd2=-(sqrt(R²-ho²));
yd2=ho;
yd=(((xd-xd1)./(xd2-xd1)).*(yd2-yd1))+(yd1);
plot(xd,yd,'k')
The result is:
Eror using .* Matrix dimensions must agree.
Please help mee ?
*code formatted by Adam Danz; the squared superscripts are ambiguous (^2 or .^2) so I left them as-is - AD
3 comentarios
KALYAN ACHARJYA
el 9 de En. de 2020
Editada: KALYAN ACHARJYA
el 9 de En. de 2020
Please define all those parameters. R,ho,x3,sd1....etc
David Hill
el 9 de En. de 2020
You need to provide more information. Look at the size of each of your matrixes. If you want help you will need to provide examples of your variables.
Saskia Nur Santika
el 9 de En. de 2020
Respuesta aceptada
Más respuestas (1)
Mateus Banroc
el 9 de En. de 2020
Hi Saskia,
In your code, I guess that only xd and yd are vectors, right? So x3, y3, R and ho should be scalars.
I don't know what are the values of these scalars but I tried this and it worked.
R=10; ho=2;
x3=10;
y3=10;
xd=-(sqrt(R^2-ho^2)):0.5:x3;
xd1=x3;
yd1=y3;
xd2=-(sqrt(R^2-ho^2));
yd2=ho;
yd=(((xd-xd1)./(xd2-xd1)).*(yd2-yd1))+(yd1);
plot(xd,yd,'k')
You must check if R, ho, x3, y3 are scalars.
1 comentario
Saskia Nur Santika
el 9 de En. de 2020
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!