07 - Common functions and indexing 1
Define _cMat_:
<<http://samle.dk/STTBDP/Assignment1_3c.png>>
( _cMat_ = 10x10 matrix where the numbers from 1 to 100 runs ...
07 - Common functions and indexing 6
Create a variable _m_ as a magic square with the size 6 x 6
Magic squares are defined as square matrices, where the sum of a...
5年以上 前
解決済み
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]
5年以上 前
解決済み
Area of a circle
Find the value for area of the circle if diameter is given
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:
...
5年以上 前
解決済み
Deleting an element in a matrix
For vector Grades=[98 56 78 34 100 88 87], delete the number 78 to get the following matrix
Grades=[98 56 34 100 88 87]
**re...
MATCH THE STRINGS (2 CHAR) very easy
Match the given string based on first two characters on each string.
For example
A='harsa';
b='harish'; result '1'
...
Sum of the Matrix Elements
Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.
E...
5年以上 前
解決済み
Replace multiples of 5 with NaN
It is required to replace all values in a vector that are multiples of 5 with NaN.
Example:
input: x = [1 2 5 12 10 7]
...
5年以上 前
解決済み
How many days in a month?
Return the number of days in a given month in 2017. If the input is not a valid month number, return -1.
Examples:
Input...
Unit Matrix
Given n, you should return an n-by-n unit matrix.
Example:
If input is n=2 then
A = [ 1 0
0 1 ]
If input ...
5年以上 前
解決済み
Calculate area of sector
A=function(r,seta)
r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...