Simple question about scatter/data plots
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Say I have two scripts. The first one is called RideData. It contains four arrays that are called speed, distance, climb, and calories. Those are the four variables assigned to four arrays. The second script is the main one where I want to create a scatter/data plot. If I wanted to use the speed and distance arrays from the first script to plot in the second script, how would I call the first script in order to plot using those arrays?
0 Commenti
Risposta accettata
TADA
il 6 Dic 2018
Your best option is to change your RideData script into a function (see documentation about functions) and have that function return those arrays, something like that:
function [speed, distance, climb, calories] = RideData()
% enter your functionality here
end
then you simply call the function from your main script like that:
[speed, distance, climb, calories] = RideData();
% now you can plot your stuff
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Scatter 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!