Plotting a semilogx plot with a table

4 visualizzazioni (ultimi 30 giorni)
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!

Risposta accettata

Walter Roberson
Walter Roberson il 5 Gen 2021
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 ()

Più risposte (0)

Categorie

Scopri di più su Line Plots 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!

Translated by