Gelöst


Maintain shape of logical-index mask
When using logical indexing into an array, MATLAB returns a vector output. For example, if A = magic(3); mask = logi...

fast 13 Jahre vor

Gelöst


Pi Estimate 1
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

fast 13 Jahre vor

Gelöst


Pizza value using expression with parentheses
Pizza prices are typically listed by diameter, rather than the more relevant feature of area. Compute a pizza's value (cost per ...

fast 13 Jahre vor

Gelöst


Multielement indexing of a row array
The row array birthRateChina stores the China birth rate (per 1000 people) for years 2000 to 2012. Write a statement that create...

fast 13 Jahre vor

Gelöst


Lightning strike distance: Writing a function
Write a function named LightningDistance that outputs "distance" given input "seconds". Seconds is the time from seeing lightnin...

fast 13 Jahre vor

Gelöst


Create a row array using double colon operator
Create a row array from 9 to 1, using the double colon operator.

fast 13 Jahre vor

Gelöst


Circle area using pi
Given a circle's radius, compute the circle's area. Use the built-in mathematical constant pi.

fast 13 Jahre vor

Gelöst


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

fast 13 Jahre vor

Gelöst


Fahrenheit to Celsius using multiple statements
Given a Fahrenheit value F, convert to a Celsius value C. While the equation is C = 5/9 * (F - 32), as an exercise use two state...

fast 13 Jahre vor

Gelöst


sum of first 'n' terms
Given n=10, find the sum of first 'n' terms Example: If n=10, then x=1,2,3,4,5,6,7,8,9,10. The sum of these n=10 terms is 55...

fast 13 Jahre vor

Beantwortet
Calling variables using variable list in character array
You could create a structure from the string of variable names, like so: varNames = ['var1';'var2';'var3']; %example charac...

fast 13 Jahre vor | 2

Gelöst


Set some matrix elements to zero
First get the maximum of each *row*, and afterwards set all the other elements to zero. For example, this matrix: 1 2 3 ...

fast 13 Jahre vor

Gelöst


Find the list of all open files
In the test suite, I use <http://www.mathworks.com/help/matlab/ref/fopen.html fopen> to create new files. The task is to find th...

fast 13 Jahre vor

Gelöst


Simple date to serial no. conversion
Convert a date string to a serial date number. For example if you take x='19-May-2001' then the result is 730990 x...

fast 13 Jahre vor

Gelöst


Get the elements of diagonal and antidiagonal for any m-by-n matrix
In the problem <http://www.mathworks.com/matlabcentral/cody/problems/858-permute-diagonal-and-antidiagonal Problem 858. Permute ...

fast 13 Jahre vor

Gelöst


Create a matrix from a cell
In this problem , you must convert a cell into a matrix and pad each cell with NaN. *Example 1:* If you have the input...

fast 13 Jahre vor

Gelöst


Parasitic numbers
Test whether the first input x is an n-parasitic number: <http://en.wikipedia.org/wiki/Parasitic_number>. ( _n_ is the second in...

fast 13 Jahre vor

Gelöst


does it touch ?
given a sentence, tell how much it touches. input : string output : how much it touches touching : a bilabial phoneme d...

fast 13 Jahre vor

Gelöst


Remove the small words from a list of words.
Your job is to tidy up a list of words that appear in a string. The words are separated by one or more spaces. Remove all words ...

fast 13 Jahre vor

Beantwortet
Automatically update plots in GUI
So you want your axes to update whenever data is typed into your editboxes? If so, wouldn't you just put the relevant code into ...

fast 13 Jahre vor | 0

| akzeptiert

Gelöst


Matrix with different incremental runs
Given a vector of positive integers a (>=0); How does one create the matrix where the ith column contains the vector 1:a(i) poss...

fast 13 Jahre vor

Beantwortet
How can I randomly select a row from a matrix?
Try this: ind = ceil(rand * size(m,1)); mrow = m(ind,:);

fast 13 Jahre vor | 3

| akzeptiert

Beantwortet
How can I fill an array of images from inside a for loop?
It looks like you're trying to assign a [nxm] matrix (the image) to a [1xm] row in AllFaces. Instead, try this: AllFaces(:,...

fast 13 Jahre vor | 0

Beantwortet
fprintf: Function is not defined for 'cell' inputs.
It sounds like "problem_statement" is a cell array, and fprintf cannot accept cells as arguments. What if you change the second ...

fast 13 Jahre vor | 0

Beantwortet
How do you enable a user to maximize an axes on a matlab GUI?
Do you mean you want the user to be able to set the axes to fill the GUI window? To do this, you could change the "Position" pro...

fast 13 Jahre vor | 0

Beantwortet
Replicating a matrix in matlab
Because the amount you're replicating each element of V by varies according to p, the resulting rows in A are not of the same si...

fast 13 Jahre vor | 0

Beantwortet
double to string in a cell
help cellfun

fast 13 Jahre vor | 0

Gelöst


Sunday bonus
Submit a solution on any Sunday and you will get 10 points. Only for MATLAB fans!

fast 13 Jahre vor

Gelöst


Spot the outlier
All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

fast 13 Jahre vor

Beantwortet
Plot multiple graphs to a single axis handle
Something like hold(axes_handle,'on') should work. The only thing I can think of without seeing more of your code is th...

fast 13 Jahre vor | 6

| akzeptiert

Mehr laden