Effacer les filtres
Effacer les filtres

Plotting a semilogx plot with a table

4 vues (au cours des 30 derniers jours)
Nat Person
Nat Person le 5 Jan 2021
Commenté : Nat Person le 5 Jan 2021
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!

Réponse acceptée

Walter Roberson
Walter Roberson le 5 Jan 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 ()
  1 commentaire
Nat Person
Nat Person le 5 Jan 2021
Ah I feel silly, thank you so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by