Model a mass spring system
Model an ideal mass-spring system shown below where the spring is initially stretched.
<<http://blogs.mathworks.com/images/se...
約9年 前
解決済み
MPH to MPS
Given mps, find the speed in miles per hour.
約9年 前
解決済み
Add damping to a mass spring system
Model an ideal mass-spring-damper system shown below where the spring is initially stretched.
<<http://blogs.mathworks.com/im...
Vectorize the digits of an Integer
Create a vector of length N for an integer of N digits.
x=123045;
x_vec=[1 2 3 0 4 5];
I happened upon a trick to do ...
9年以上 前
解決済み
Maximum value in a matrix
Find the maximum value in the given matrix.
For example, if
A = [1 2 3; 4 7 8; 0 9 1];
then the answer is 9.
9年以上 前
解決済み
Count from 0 to N^M in base N.
Return an array of numbers which (effectively) count from 0 to N^M-1 in base N. The result should be returned in a matrix, with ...
9年以上 前
解決済み
Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.
kmph to mps
convert kilometer per hour to meter per second
9年以上 前
解決済み
sum of non-primes
The sum of the non-primes below 10 is 1+4+6+8+9+10=38
Find the sum of all the non-primes below the input, N.
9年以上 前
解決済み
Logical operators: Flipping bits
The xor operator will toggle the bit if the bit is xored with 1. Ex: 1 XOR 0 = 1, 1 XOR 1 = 0.
The xor operator will retain th...
9年以上 前
解決済み
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]
...
Min of a Matrix
Return the minimum value in the given matrix.
9年以上 前
解決済み
Back to basics 26 - Keywords
Covering some basic topics I haven't seen elsewhere on Cody.
Return a cell array of strings of all MATLAB keywords.
9年以上 前
解決済み
Back to basics 20 - singleton dimensions
Covering some basic topics I haven't seen elsewhere on Cody.
Remove the singleton dimensions from the input variable (e.g. if...
9年以上 前
解決済み
Constructing strings
* Construct a string alphaString from 'a' to endLetter, using the double colon operator.
Ex: If endLetter = 'e', then alphaSt...
9年以上 前
解決済み
Distance walked 3D
suppose you go from x-y-z coordinates [3,4,2] to [0,0,2] to [0,1,2] to [1,1,2], to [1,1,20] then you walked 25 units of distance...