i have two arrays in matlab code and i want to plot them by two lines on the same graph
66 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i have two arrays in matlab code and i want to plot them by two lines on the same graph
0 Commenti
Risposte (1)
Soniya Jain
il 10 Lug 2021
plot(Array1);
hold on;
plot(Array2);
hold off;
hold will retain current plot when adding new plots.
4 Commenti
Soniya Jain
il 10 Lug 2021
Modificato: Soniya Jain
il 10 Lug 2021
I guess you are trying to plot cell array as using {}, which is invalid argument in plot function, so you can first covert cell array to vector using
or
functions, and then try plotting.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/680288/image.png)
![str2double](https://www.mathworks.com/matlabcentral/answers/uploaded_files/680293/image.png)
Vedere anche
Categorie
Scopri di più su 2-D and 3-D 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!