plot functions not working: Error finding class matlab.gra​phics.char​t.primitiv​e.Line

23 ビュー (過去 30 日間)
Jack Michael
Jack Michael 2024 年 2 月 6 日
回答済み: Shubham 2024 年 2 月 7 日
Hey all,
Everytime I try to plot something I get the following error:
Error finding class matlab.graphics.chart.primitive.Line.
For example,
>> plot(x, y)
Error using plot
Error finding class matlab.graphics.chart.primitive.Line.
Thank you!
  5 件のコメント
Steven Lord
Steven Lord 2024 年 2 月 6 日
Before reinstalling MATLAB, a slightly smaller hammer that might resolve the problem (if the cause is a corrupted MATLAB search path) would be to try restoredefaultpath.
Jack Michael
Jack Michael 2024 年 2 月 7 日
Even upon reinstalling, I am getting the same error. I have even tried installing previous verisons.

サインインしてコメントする。

回答 (1 件)

Shubham
Shubham 2024 年 2 月 7 日
Hi Jack,
The error message you're seeing suggests that MATLAB is having trouble locating the class definition for the Line object, which is a fundamental part of MATLAB's plotting system. This could be due to several reasons, such as a corrupted MATLAB installation, issues with the MATLAB path, or problems with Java on your system.
Here are some steps you can try to resolve this issue:
  1. Ensure that the MATLAB path has not been altered to exclude important directories. You can reset the path to the default by using the command:
restoredefaultpath;
rehash toolboxcache;
matlab.graphics.chart.primitive.Line;
2. Sometimes, clearing the Java cache can resolve issues related to MATLAB's Java-based components:
clear java;
3. Try reinstalling the MATLAB as there might be a deeper issue with the MATLAB installation.

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by