How to make the x and y axis labels and the title an input argument for a function
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
So here is the code that I have to keep for my class assignment. I am trying to figure out how to make it that the title and the axis labels are an input by the user and not hard coded.
function filePlot(filename,graphTitle,xAxisLabel,yAxisLabel)
raw_data=load(filename);
% Assign the first column of data in raw_data to x, and the 2nd to y.
% Create a scatter plot of the fish counts vs. the gas concentration.
% Add appropriate graph title and axis labels.
% For both x and y, display the mean and standard deviation in the command window.
endfunction
I have everything else and it works fine except for there is no title or axis labels. Here is the code that I have so far.
fish=raw_data(:,1);
dissolved_gas=raw_data(:,2);
scatter(fish,dissolved_gas,'*:b')
M = mean(fish)
M = mean(dissolved_gas)
S = std(fish)
S = std(dissolved_gas)
0 Commenti
Risposte (1)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!