Figure() Function doesn't work
20 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Exactly as the title says. I cannot find anyone else with this issue so any help would be much appreciated. Here are some snippets of my code:
f = @(x) 1/sqrt(2*pi).*exp(-1/2.*(x.^2));
df = @(x) 1/sqrt(2*pi).*exp(-1/2.*(x.^2)) .* -x;
f_l = @(x,c) df(c).*(x-c) + f(c);
x_var = linspace(0,2.2,100);
actual_y = f(x_var);
linear_y = f_l(x_var,1);
figure(1)
plot(x_var , actual_y , x_var , linear_y)
xlim([0 2.2])
yline(0)
This code never produces a figure 1. It has managed to produce figure 3, figure 4, figure 6, and plenty of figure 11's all without the code you are looking at changing. The only thing that could be changed between those events is that clear all, close all, close all hidden or various other commands were tried. Putting figure(#) in my command window does nothing. i have tried to use figure(2) and figure(3) later in the code but they are equally useless. It really just feels like the figure() function doesn't work on my MATLAB. As far as I can remember, this has never worked for me either. Please let me know if I am doing anything wrong, but I cannot find any solution to this.
8 Commenti
Walter Roberson
il 1 Mar 2024
There was recently a similar report, https://www.mathworks.com/matlabcentral/answers/2086138-create-new-figures-with-matlab-live-script#comment_3076393
Risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
