Error using plot Invalid data argument.

This is my program. Need help to solve it.
clc;
t = readtable('error graph.xlsx','Sheet','Sheet1');
x = t.ModelName;
y = t.Rmse;
z = t.R_2;
plot(x,y)
hold on
plot(x,z)
hold on

Antworten (2)

Walter Roberson
Walter Roberson am 21 Sep. 2024

0 Stimmen

I would guess that you need
plot(categorical(x), y)
and
plot(categorical(x), z)
Voss
Voss am 21 Sep. 2024

0 Stimmen

Try replacing

x = t.ModelName;

with

x = categorical(t.ModelName);

And run the code again.

If that doesn't work, attach the xlsx file using the paperclip button.

Kategorien

Mehr zu Data Distribution Plots finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 21 Sep. 2024

Beantwortet:

am 21 Sep. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by