1. Given the V\" vector below, write brief Matlab scripts to compute the sum of
ID: 2086005 • Letter: 1
Question
1. Given the V" vector below, write brief Matlab scripts to compute the sum of all the elements in the "V" vector using the or" loop (Note: The Matlab's build-in function sum' is NOT allowed) (8 pts) V-[9 3 -15 6]; 2. Write brief Matlab scripts using nested "for" loops to compute the matrix product of [A] [B] using [A] and [B] below. (10 pts) 0.1 2 3 0.52 3 0.48 0.09 4]=10.44 0.6 | [B-2 4 3. Write brief Matlab scripts to evaluate the following functions at different temperatures. (10 pts) when T s100 when T>100 h(T) T-20 = 0.67' + 40 a, T=5,h=? b. T-105, h-? Test cases: 4. Given these data 29.65 28.55 28.65 30.15 29.35 29.75 29.25 Write brief Matlab scripts using "for" loops to determine the following: (Note: Matlab's built-in functions "mean", "sum", and "std" are NOT allowed). (10 pts) (i) he mean; (i) the standard deviation; (ii) the variance, and iv) the coefficient of variance
Explanation / Answer
MATLAB script:-
clc
clear
V= [9 3-15 6];
n = max(size(V));
S=0;
for i=1:1:n
summation =S+V(i);
end
summation
Output:-
summation=3
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.