Is there any log-scale for symbolic functions?

6 views (last 30 days)
close all; clear all; clc
syms x y
Dt = 0.15*10^-6;
e = exp(-y^2);
Eint = int(e,[0 x/(2*Dt)]);
C = 10^20*(1-(2/sqrt(pi)*Eint));
figure(1)
fplot(C,[0 2*10^-6])
figure(2)
fplot(C,[0 2*10^-6])
set(gca, 'YScale', 'log');
Warning: Error updating FunctionLine.

DataSpace or ColorSpace transform method failed.
//
It's my code. I never get this Y logscale plot.
Eventhough I use 'set(gca, 'YScale', 'log');' , It doesn't work.
How can I get this logsacle graph? Help........

Answers (2)

Matt J
Matt J on 1 Nov 2020
Edited: Matt J on 1 Nov 2020
This also seems to work, as long as you don't care whether your plot line is of type Line or FunctionLine
figure(2);
h=fplot(C,[0 2*10^-6]);
semilogy(h.XData,h.YData)

Star Strider
Star Strider on 1 Nov 2020
I get Warnings and no line when I try that. I have no idea what the problem could be.
Meanwhile, see if this work-around does what you want:
figure(2)
fplot(log10(C),[0 2E-6])
Ax2 = gca;
yt = Ax2.YTick;
Ax2.YTickLabel = sprintfc('10^{%2d}',yt);
.

Categories

Find more on Line Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!