Basic queries Matlab (vectors, indexing, construct matrices in a specific form)
이전 댓글 표시
Hello community,
I am beginner in Matlab. I am struggling with the following exrcises. I only managed to answer 1 & 5 however the others confuse me and I don't even know how to start specially with 2 & 3. Please I need your help

My solutions:
%Exercise 1
x = [2:3:89]
%Exercise 5
function density=ExamC()
x=input('Please enter x: ');
m=input('Please enter mean: ');
s=input('Please enter standard deviation: ');
f=1/(s*sqrt(2*pi))*exp(1)^((1/2)*((x-m)/s)^2);
disp('Value of density is: '), disp(f);
end
Thank you for your help,
Abdel
댓글 수: 5
per isakson
2020년 5월 24일
편집: per isakson
2020년 5월 24일
Maybe it would be worth spending a couple of hours with Learn the essentials of MATLAB through this free, two-hour introductory tutorial on commonly used features and workflows.
Abderrahmane Elakhiri
2020년 5월 24일
Stephen23
2020년 5월 24일
"Specially question 2. It would be nice of you if you can simplify in simple words what's exactly required or the logic to answer it."
Question 1 defines a vector named vec.
Question 2 requires you to change the even-indexed elements of vec to 5.
Abderrahmane Elakhiri
2020년 5월 24일
per isakson
2020년 5월 24일
Or
%Exercise 2:
vec = [1 2 3 4 5 6 7 8 9 10];
vec( 2 : 2 : end ) = 5;
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!