Trouble with plotting on log scale with current data
Show older comments
So I have the plot down for linear scale but when I go to use the same code for log scale, using loglog, I get an error message. I believe its from using a syms on theta.
"Data must be numeric, datetime, duration or an array convertible to double."
Was looking for some points on how to change my code to accept my data to plot on log.
syms theta
kD = 0.1:10;
x = (kD.*sin(theta));
R = (1 - ((2*besselj(1,x))./(x)));
X = ((2*besselj(1,x))./(x)) + (((2*bessely(1,x))./(x))*1i);
figure(3)
fplot(R)
axis([0 1.8 -0.2 1.2])
grid on
title('Plot of Radiation Resistance and Reactance')
hold on
fplot(real(X)+ imag(X))
axis([0 1.8 -0.2 1.2])
grid on
hold off
loglog(R)
Accepted Answer
More Answers (0)
Categories
Find more on Log Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!