Plotting a semilogx plot with a table

1 次查看(过去 30 天)
I'm trying to plot two tables (Final & Inital, both 201x2) using the semilogx function.
Here's how I'm trying to do it.
subplot (2,1,1)
semilogx(Initial{:,1},Initial{:,2})
title('Final & Initial Measurements')
xlabel ('Frequency'); ylabel('Magnitude')
hold on
semilogx(Final(:,1),Final(:,2))
xlabel ('Frequency (Hz)'); ylabel('Magnitude (dB)');
legend('InM'+n+'','FM'+n+'');
hold off
But it keeps throwing the error
Error using semilogx
Data must be numeric, datetime, duration or an array convertible to double.
How do I get around this?
Thank you for any help!

采纳的回答

Walter Roberson
Walter Roberson 2021-1-5
semilogx(Initial{:,1},Initial{:,2})
That line you got right
semilogx(Final(:,1),Final(:,2))
But not that one.
Notice that the first time you used {} indexing but the second time you used ()

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by