A Five Introduction
Write a function that takes a number x as an input and returns the same value as y, unless x = 5, in which case the function sho...
21日 前
解決済み
Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
21日 前
解決済み
Pizza!
Given a circular pizza with radius z and thickness a, return the pizza's volume. [ z is first input argument.]
Non-scored bonus...
21日 前
解決済み
The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...
Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not to use d...
Convert from Fahrenheit to Celsius
Given an input vector F containing temperature values in Fahrenheit, return an output vector C that contains the values in Celsi...
21日 前
解決済み
Sum of series
a(n) = n^2 - (n-1)^2
find the summation of the series upto n i.e.
a(1)+a(2)+...+a(n)
21日 前
解決済み
Find MPG of Lightest Cars
The file cars.mat contains a table named cars with variables Model, MPG, Horsepower, Weight, and Acceleration for several classi...
21日 前
解決済み
Matlab Basics - Rounding II
Write a script to round a variable x to 3 decimal places:
e.g. x = 2.3456 --> y = 2.346
Beginner's Problem - Squaring
Try out this test problem first.
Given the variable x as your input, square it by two and put the result in y.
Examples:
...
21日 前
解決済み
First N Perfect Squares
*Description*
Return the first N perfect squares
*Example*
input = 4;
output = [ 1 4 9 16 ];
Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.
21日 前
解決済み
Engine torque and RPM
Torque and power are related through rotational speed. Knowing brake power and engine RPM, you can back-calculate the torque del...
21日 前
解決済み
Engine Thermal Efficiency
The thermal efficiency of an ideal Otto cycle engine depends only on the compression ratio. A higher compression ratio yields gr...
21日 前
解決済み
MATLAB 101: Area of a circle
Write a MATLAB function named circle_area that accepts the radius r as an input and returns the area of the circle.
21日 前
解決済み
Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...