Resuelto


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...

casi 13 años hace

Resuelto


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

casi 13 años hace

Resuelto


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 ...

casi 13 años hace

Resuelto


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...

casi 13 años hace

Resuelto


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

casi 13 años hace

Resuelto


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

casi 13 años hace

Resuelto


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

casi 13 años hace

Resuelto


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...

casi 13 años hace

Resuelto


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...

casi 13 años hace

Resuelto


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...

casi 13 años hace

Respondida
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...

casi 13 años hace | 2

Resuelto


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 ...

casi 13 años hace

Resuelto


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...

casi 13 años hace

Resuelto


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...

casi 13 años hace

Resuelto


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 ...

casi 13 años hace

Resuelto


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...

casi 13 años hace

Resuelto


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...

casi 13 años hace

Resuelto


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

casi 13 años hace

Resuelto


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 ...

casi 13 años hace

Respondida
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 ...

casi 13 años hace | 0

| aceptada

Resuelto


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...

casi 13 años hace

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

casi 13 años hace | 3

| aceptada

Respondida
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(:,...

casi 13 años hace | 0

Respondida
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 ...

casi 13 años hace | 0

Respondida
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...

casi 13 años hace | 0

Respondida
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...

casi 13 años hace | 0

Respondida
double to string in a cell
help cellfun

casi 13 años hace | 0

Resuelto


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

casi 13 años hace

Resuelto


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 ...

casi 13 años hace

Respondida
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...

casi 13 años hace | 6

| aceptada

Cargar más