Pi Digit Probability
Assume that the next digit of pi constant is determined by the historical digit distribution. What is the probability of next di...
3年以上 前
解決済み
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 numbe...
3年以上 前
解決済み
Pi Estimate 1
Estimate Pi as described in the following link:
<http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>
Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.
3年以上 前
解決済み
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...
Funny problems
Generate the following vector:
if n=1
then
q=1;
elseif n=2 then
q=[2 2 1];
elseif n=3 then
q=[3 3 3 2 2 1];
...
end
3年以上 前
解決済み
The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".
Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...
Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be.
Ex...
3年以上 前
解決済み
Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following:
* ...
3年以上 前
解決済み
Remove element(s) from cell array
You can easily remove an element (or a column in any dimension) from a normal matrix, but assigning that value (or range) empty....
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'
Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column:
in:
...