Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because
6 = 1 + 2 + 3
which can be displayed ...
約3年 前
解決済み
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...
約3年 前
解決済み
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年 前
解決済み
Where the Four Corners Am I?
The "Four Corners" region of the US is where Colorado, Utah, Arizona, and New Mexico all meet - the only place where four states...
Convert Volume Mixing Ratio to Density
The partial pressure of a constituent gas species of the atmosphere can be expressed in parts per million by volume. For exampl...
Calculate Wind Chill Factor
The NWS Wind Chill Temperature (WCT) index formula for calculating the dangers from winter winds and freezing temperatures:
Cal...
Air Density from Temperature and Pressure
The density of air can be estimated from the product of molar mass and molar density:
Write a function that finds the densi...
約3年 前
解決済み
Fibonacci sequence
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Input...