- ' x*x ' is considered as matrix multiplication and as dimensions doesn't match there is an error.
- Cosine of a number is programmed as ' cos(number) '.
- The range of Y-axis is [0, 2e4] and X-axis is [0, 100]. Using 'axis equal' command will not plot the graph appropriately.
無法輸出所要繪製的圖形
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
繪出x = y=2t^2-3tcos2\pi60t+2的圖形
这是程序代码
xlabel('x = y=2t^2-3tcos2\pi60t+2');
title('homework of the Function','FontSize',12)
axis([0 50 0 50])
x = 0:100;
y=2*x*x-3*cos*pi60t+2
plot(y,'c:h')
%axis([0 50 0 50])
axis equal
运行后無法出現圖形
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in
the first matrix matches the number of rows in the second matrix. To operate on each
element of the matrix individually, use TIMES (.*) for elementwise multiplication.
0 comentarios
Respuestas (1)
V Sairam Reddy
el 9 de Dic. de 2022
Hi Snow,
After investigating the shared code snippet, these are some following issues being identified:
Please follow the below code to make it work:
xlabel('x = y=2t^2-3tcos2\pi60t+2');
title('homework of the Function','FontSize',12)
axis([0 50 0 50])
x = 0:100;
y=2*x.*x-3*x.*cos(2*pi*60*x)+2;
plot(y,'c:h')
%axis([0 50 0 50])
%axis equal
It is recommonded to take the free 'MATLAB Onramp' course to familiarize with programming in MATLAB.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!