필터 지우기
필터 지우기

Error using plot()

조회 수: 7 (최근 30일)
Collin Curtis
Collin Curtis 2021년 10월 24일
편집: Siraj 2024년 2월 21일
Get this error when trying to use the plot() function on MATLAB online. I tried refreshing the page, and closing and reopening the website. Error does not seem to be attached to my code. I tried a number of different plots. This may be unrelated but it will also not allow me to close the figure 1 tab. Plot was working before.

답변 (1개)

Siraj
Siraj 2024년 2월 21일
편집: Siraj 2024년 2월 21일
Hi!
I understand that you're encountering an issue when trying to use the "plot" function in MATLAB Online. Based on the error message you've encountered, it seems that the problem may not be related to your code. I've tested the "plot" function with some sample code on my end, and it appears to be working correctly. Since you haven't provided the "dataset1.mat" file you are using, pinpointing the exact cause of the error is challenging.
Try running the following sample code to see if the error still occurs:
x = linspace(0, 2*pi, 1000); % 1000 points between 0 and 2*pi
% Define the function to be plotted (sine function in this case)
y = sin(x);
% Create the plot
figure; % Creates a new figure window
plot(x, y, 'b-', 'LineWidth', 2); % Plots the sine wave with a blue line
title('Sine Wave Plot');
xlabel('x (radians)');
ylabel('sin(x)');
If this sample code executes without any errors, there could be an issue with the "dataset1.mat" file.
Additionally check if there’s some other script or function that is shadowing the “plot” function. To do so, you can execute the following command in the Command Window.
which -all plot
This will reveal if any other scripts or functions are overshadowing the "plot" function.
If the “plot” function is not overshadowed but the issue persists here are a few steps you can try:
  1. Clear the cache and cookies of your browser, then reload MATLAB Online.
  2. Log in to the following link https://drive.matlab.com/files with your MathWorks Account credentials.
  3. Click on username to show dropdown and check the box to "Show Hidden Files"
  4. Rename the "/MATLAB Drive/.session" folder to "/MATLAB Drive/.session-backup"
  5. Go to https://matlab.mathworks.com and try re-using MATLAB Online.
Hope this helps.

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by