Find out magnitude of vector
Find out magnitude of vector.
Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2)
Please don't use sum function.
If you l...
Matlab Basics II - Log and natural log
Write a function that calculates the difference between the log and natural log of a vector, to two decimal places
example:
...
Flipping a Matrix
Flipping matrix up and down.
If a central row is exists, leave it, and flip remaining rows.
Example
Mat = magic(3)
...
6ヶ月 前
解決済み
Half-Swap
Given a vector with an even number of elements,
rearrange it so that the elements in its first
half are switched with those i...
6ヶ月 前
解決済み
Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example
start with x = 1 and y = 3
end with y = 1 and x = 3
Do NOT simply r...
6ヶ月 前
解決済み
Prime numbers between a , b.
Find all prime number between a & b (including a and b).
example:
a=100
b=120
y= [101 103 107 109 113]