Hi,
How can I perform such task concering iris dataset?
Now plot histograms of all variables coloring them by species. Use hold on to overlay plots for different datasets on one figure. Which variables separate species well?
Thanks

댓글 수: 4

Cris LaPierre
Cris LaPierre 2023년 1월 10일
What have you tried?
Zuzanna
Zuzanna 2023년 1월 10일
Well, Yeasterday I had my first lecture in Matlab so Im really a begginner and I have no idea how to type sth. For another example " make a combined version of the plots using the function gplotmatrix" I've used this: gplotmatrix(meas,[],species) and I received a histogram. But concerning the question and this command hold I have no idea how to do this
Cris LaPierre
Cris LaPierre 2023년 1월 10일
편집: Cris LaPierre 2023년 1월 10일
Walter gives a simple example below. If you want a quick introduction to plotting in MATLAB, consider going through Ch 9 of MATLAB Onramp. It doesn't cover histograms specifically, but does show you how to call plotting functions, including adding multiple plots to the same axes. It should take about 10-15 mins to complete.
If you find that helpful, you might consider going through some of the other chapters as well. Is a nice, free way to learn the fundamentals of MATLAB.
Zuzanna
Zuzanna 2023년 1월 10일
Thank you! I will do that :)

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2023년 1월 10일

1 개 추천

x1 = rand(1,100);
x2 = rand(1,100).^2 + 0.1;
x3 = exp(rand(1,100));
histogram(x1);
hold on
histogram(x2);
histogram(x3);
hold off
legend({'x1', 'x2', 'x3'})

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

제품

릴리스

R2022b

질문:

2023년 1월 10일

편집:

2023년 1월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by