Solved


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

14 years ago

Solved


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

14 years ago

Answered
Pad a character array with n zeros
To pad a single string: sprintf('%010s','11'); To pad a cell array of string: C = {'010';'1';'0111';'01010101'}; ...

14 years ago | 0

Answered
Plot a graph
t=0:0.01:10; a = [2 3]; x=a'*t; y=sin(x); plot(x',y')

14 years ago | 0

| accepted

Answered
Plotting a function
You need a . before a ^ so that it is an element by element power instead of a matrix power. doc vectorize will probably...

14 years ago | 0

Solved


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

14 years ago

Answered
ga
Interesting idea. This should be possible, probably with non-linear constraint option. However, (disclaimer: this is just a ...

14 years ago | 0

| accepted

Answered
save a variable nameing it after a string
Either <http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F This> or <http://matlab.wi...

14 years ago | 1

Answered
matrix
gallery('randcorr',12) creates a 12x12 positive semidefinite matrix.

14 years ago | 0

Answered
How to best to accept list input from a dialog box?
uicontrol('style','list','string',cellfun(@num2str,num2cell(1:10)','uni',false))

14 years ago | 0

Answered
How can i solve this equation to n ?
fzero(@(n)1-(gammainc(x,a)/gamma(n))-R,5) Maybe? You'll hit overflow if you start with a big n.

14 years ago | 0

Answered
Copying cells in cell arrays
A = repmat(num2cell(rand(11,1)),1,11)

14 years ago | 0

| accepted

Answered
To confirm that a matrix has full row rank, for hinfsyn command ?
Perhaps |rank()|? doc rank

14 years ago | 0

Answered
I added a Background Image but now I can't see panels...
H = uipanel(..) What does: get(H,'backgroundcolor') return?

14 years ago | 0

Answered
Matlab R14 dll does not work under Windows 7
<http://www.mathworks.com/matlabcentral/answers/89-is-matlab-supported-on-windows-7 Ian's Answer>

14 years ago | 0

Answered
finding rotation of angle
showdemo ipexaerial Might help get you started.

14 years ago | 0

Answered
Speed up the code
Using |colfilt()|: I = magic(5); Imin = colfilt(padarray(I,[1 1],inf),[3 3],'sliding',@(x)(min(x,[],1)==x(5,:))); Imi...

14 years ago | 0

Answered
simultaneous equations
If you have the Optimization Toolbox: doc fsolve If you have the Symbolic Math Toolbox: doc solve

14 years ago | 0

Answered
Timer function in OOP object constructor not working as expected
The timer passes two input arguments to its _timerfcn_. The function you are using must be able to accept these. function ...

14 years ago | 0

| accepted

Answered
Generate Uniformly distributed random integers between 1 to 200 but without integers that are multiples of 5 (for ex: 5,10,15 should not appear in the output)
v = 1:200; %random integers between 1,200; v(~mod(v,5)) = []; %remove ones dividisble by 5 idx = ceil(rand(5)*numel(v));...

14 years ago | 1

Answered
Evaluating 3D Function
I would use |bsxfun()| to generate the grid of points in 3d. If this approach wouldn;t work, you could always use |ndgrid()| an...

14 years ago | 0

Answered
Bifurcation GUI
<http://www.mathworks.com/matlabcentral/fileexchange/?term=bifurcation+type%3A%22app%22 FEX:[app]bifurcation>

14 years ago | 0

Answered
Altering Default MaxFunEvals
You're not passing the _options_ structure to |fsolve()| options = optimset('MaxFunEvals',1e10); [result, fval, exit, ou...

14 years ago | 0

Answered
vectorise the for loop below to find the xor
the first two for-loops can be easily vectorized with source_data = rand(10,20)<0.8; G = rand(10,15)<0.9; I'm sure the ...

14 years ago | 1

Answered
Problems with defining upper and lower bounds
The final output value is inside the range though, right? I believe |ga()| is showing every attempt, even if the attempt falls ...

14 years ago | 0

Answered
Help removing unwanted lines from image and identify spots
# Threshold to create a binary object # |bwareaopen()| to get rid of small stuff # |imopen| to get rid of lines;

14 years ago | 2

| accepted

Answered
Datatip issue
perhaps |waitfor()|? Or a |drawnow| to force a flush of the graphics queue should work too.

14 years ago | 0

| accepted

Answered
extract 3D surface from 3D volume data
It sounds like you may want to create an isosurface (a volumetric contour map). doc isosurface

14 years ago | 2

Answered
Removal of For Loops
It's probably possible with |filter()| or similar. But I guarantee a well written |for|-loop will not be much slower. Just rem...

14 years ago | 1

| accepted

Answered
Plotting different functions at the end of eachother
fz10 = @(x)x+3;%two functions f1030 = @(x)(x+3)*2; t = 0:20; plot(t(t<10),fz10(t(t<10)),'r*',t(t>10&t<30),f1030(t(t>10&...

14 years ago | 0

| accepted

Load more