I can not use the command‘plot’,what should I do?

6 visualizaciones (últimos 30 días)
鑫
el 13 de Sept. de 2024
Comentada: el 13 de Sept. de 2024
error information:
错误使用 plot
查找类 matlab.graphics.chart.primitive.Line 时出错。
But I cannot find the'primitive' floder. What should I do if I want to use ‘plot’ normally?
ps:The executed program is as follows, which is a simple piece of code.
x = linspace(0,2*pi);
y1 = sin(x);
y2 = cos(x);
plot(x,y1,x,y2)
title('y1=sin(x), y2=cos(x)')
xlabel('X(m)')
ylabel('Y(m)')

Respuesta aceptada

nick
nick el 13 de Sept. de 2024
Hi 鑫 ,
The error 'Error looking up class matlab.graphics.chart.primitive.Line' suggests that MATLAB is unable to locate the class definition of the 'Line' object, which is a fundamental part of MATLAB's plotting system.
This could be due to various reasons such as a corrupted MATLAB installation, issues with the MATLAB path, or problems with Java on your system.
You can try the below-mentioned steps to resolve this issue:
  • It's possible that the MATLAB path has been altered, excluding important directories. You can reset the path to its default settings with the following commands:
restoredefaultpath;
rehash toolboxcache;
matlab.graphics.chart.primitive.Line;
  • Sometimes, issues with MATLAB's Java-based components can be resolved by clearing the Java cache. Use the following command:
clear java;
  • Try reinstalling the MATLAB as there might be a deeper issue with the MATLAB installation.

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by