Matlab Basics II - Free Fall
An object freely falling from rest under gravity covers a distance x given by:
x = 1/2 gt^2
write a function that calculat...
3ヶ月 前
解決済み
Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places:
e.g. x = 2.3456 --> y = 2.346
3ヶ月 前
解決済み
Matlab Basics - Rounding I
Write a script to round x DOWN to the next lowest integer:
e.g. x = 2.3 --> x = 2 also: x = 2.7 --> x = 2
3ヶ月 前
解決済み
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:
...
Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle.
<<https://imgur...
Approximation of Pi
Pi (divided by 4) can be approximated by the following infinite series:
pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...
For a given number of...
3ヶ月 前
解決済み
Convert a Cell Array into an Array
Given a square cell array:
x = {'01', '56'; '234', '789'};
return a single character array:
y = '0123456789'
3ヶ月 前
解決済み
Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...
3ヶ月 前
解決済み
Alternating sum
Given vector x, calculate the alternating sum
y = x(1) - x(2) + x(3) - x(4) + ...
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
3ヶ月 前
解決済み
Divisible by 2
This is the first problem in a set of "divisible by x" problems. You will be provided a number as a string and the function you ...
3ヶ月 前
解決済み
Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists.
x = [2 6 4 9 -10 3 1 5 -10];
So
...
3ヶ月 前
解決済み
Matlab Basics - Absolute Value
Write a script that returns the absolute value of the elements in x
e.g. x = [-1 -2 -3 -4] --> y = [1 2 3 4]