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...
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:
...
3ヶ月 前
解決済み
Product of Each Column
Given a matrix |mat| with |n| columns, return a row vector |v| of length |n|, where every element in |v| is the product of the |...
4ヶ月 前
解決済み
Square a Number
Given an input x, return y, which is equal to the square of x.
Dog Statistics
The vectors ht and wt contains the heights and weights of 20 golden retrievers. In some cases, it was not possible to make both ...
4ヶ月 前
解決済み
swap sign sum & multiply castles
It is an easy problem, if you know the answer.
Given a square matrix of NxN ordinary numbers.
Initially place N identical indi...
4ヶ月 前
解決済み
Flip the diagonal values
Write a program that flip the elements of main diagonal , upper and lower diagonal values of a sqare matrix.
For example if a ...
4ヶ月 前
解決済み
Swap two numbers
Example
Input:
a = 10
b = 20
Output
a = 20
b = 10
4ヶ月 前
解決済み
Matlab Basics - Switching Assignments
Switch assignments for variables x and y, for example
start with x = 1 and y = 3
end with y = 1 and x = 3
Do NOT simply r...