필터 지우기
필터 지우기

I always get my graphical output in a separate window, rather than on the same window next to the slide. How do I sort this issue?

조회 수: 80 (최근 30일)
Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering.

답변 (1개)

BhaTTa
BhaTTa 2024년 1월 2일
In MATLAB, graphical outputs typically appear in separate figure windows. However, if you're using MATLAB's Live Editor, figures can appear inline within the document. If you're not seeing inline figures in the Live Editor, try the following steps:
  1. Open your Live Script (*.mlx file).
  2. Click on any figure output in your Live Script.
  3. On the top right of the figure, click the "Dock Figure" button to toggle between inline and windowed figures.
If you're using a standard MATLAB script (*.m file) and you want to manage figure windows programmatically, you can use the figure function with properties to control the behavior:
figure('WindowStyle', 'docked'); % Docks the figure within the MATLAB IDE.
Issue with fevalJSON Function in MATLAB
The error message you're seeing indicates that the input function is not supported in the MATLAB environment you're using. This is likely because you're using MATLAB Online or another MATLAB product offering that does not support interactive input due to its non-interactive execution model.
To work around this issue, you will need to modify the fevalJSON function to avoid using the input function. Here's a general approach you could take:
  1. Identify the part of the code where input is used.
  2. Replace input with an alternative way of obtaining input, such as passing the required information as function arguments or using a pre-defined variable.
For example, if the original code is:
function result = fevalJSON(...)
% Some code
userInput = input('Please enter a value: '); % This is not supported in MATLAB Online
% Some more code
end
You could change it to:
function result = fevalJSON(userInput, ...)
% Some code
% Now userInput is a parameter of the function, not gathered using input()
% Some more code
end
And then call fevalJSON with the necessary input:
userInputValue = ...; % Define the value that would have been entered by the user
result = fevalJSON(userInputValue, ...);
By making this change, you remove the dependency on the input function and can pass the required information directly when you call fevalJSON.
If you need further assistance with the code, please provide the specific part of the code that's causing the issue, and I can give you more detailed guidance.

카테고리

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