Invalid Data Arguement when plotting
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Using a imported xlsx file with data, been trying to plot 2 different coloumns on 1 graph as shown below. However, I am getting 'error using plot. Invalid data arguement'. Both columns have the same amount of cells.
opts = spreadsheetImportOptions("NumVariables", 6);
% Specify sheet and range
opts.Sheet = "level 1";
opts.DataRange = "A2:F5121";
% Specify column names and types
opts.VariableNames = ["X_Value", "Real", "Imaginary", "Magnitude", "Phase", "Coherence"];
opts.VariableTypes = ["double", "double", "double", "double", "double", "double"];
% Import the data
lab2data = readtable('data29.xlsx');
% Plot Magnitude vs Frequency
M1 = lab2data.Magnitude(1:end);
F1 = lab2data.X_Value(1:end);
figure(1)
hold on
plot(F1, M1)
hold off
1 comentario
Respuestas (1)
Anshika Chourasia
el 6 de Dic. de 2021
Hi,
Please cross-check the correctness of the data file and refer the “readtable” function syntax for creating table from spreadsheets.
If the error stills persist, please provide more information to further investigate into the problem.
0 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!