Answered
round robin Loop.... help plz
You're never updating |totalCPUtime| so your |while| loop never exits

ungefär 12 år ago | 0

| accepted

Answered
runge-kutta
Writing a new answer so that I can use markup (MathWorks, please fix this!!). You need a couple of things - first, the time valu...

ungefär 12 år ago | 2

| accepted

Answered
Please help..About probability ?
You can do all of your dice throws with a single call to |randi| like this: randi(6, 2, n) that should get you on your w...

ungefär 12 år ago | 0

| accepted

Answered
Writing a sin function program dealing with factorials, help in editing and error?
I take it this is a programming exercise, not a straight mathematics question - you can work out the number of terms pretty easi...

ungefär 12 år ago | 0

Answered
How to create non-repetitive random integers
randperm(100, 70)

ungefär 12 år ago | 1

Answered
Where do people learn "bad" programming habits (i.e., goto, global, and eval)
At my university it's usually the engineering school's fault. When students learn to solve ODEs with MATLAB they seem think the ...

ungefär 12 år ago | 2

Answered
Calculating the volume inside an arbitrary closed surface
If you have R2012a doc integral2 Otherwise doc quad2d

ungefär 12 år ago | 0

| accepted

Answered
Index exceeds matrix dimensions.
The line you want is: vtemp = [xtemp,ytemp]; |xtemp| and |ytemp| are numbers not vectors

ungefär 12 år ago | 0

| accepted

Answered
Unknown Error
The fourth argument to |csvread| should be a range, i.e. a vector with four entries. You have |'eof'|. Try removing this argumen...

ungefär 12 år ago | 0

Answered
Simple Constraint Question for Quadprog Problem
As far as I can understand your code, you have a constraint that the sum of |x| is 1, and hence the required constraint is that ...

ungefär 12 år ago | 0

Answered
i dunno why it run until 4th iteration then stopped...can anybody help me? it did not give any error...
OK, with the disclaimer that what you have there isn't a particularly optimal way to write this code, you can fix your problem b...

mer än 12 år ago | 0

| accepted

Answered
How to plot Message Signal using MATLAB ?? (Quick Question Need Help)
First, note that the integral of the message will be zero up to any multiple of 2*pi. The integral will then be a piecewise line...

mer än 12 år ago | 1

| accepted

Answered
How to plot Message Signal using MATLAB ?? (Quick Question Need Help)
m_1 = @(t) 2*(cos(t) >= 0) - 1 t = linspace(0, 100); stairs(t, m_1(t))

mer än 12 år ago | 1

Answered
i dunno why it run until 4th iteration then stopped...can anybody help me? it did not give any error...
It stops because |dv1| drops below its threshhold, causing the loop to quit.

mer än 12 år ago | 0

Answered
i dunno why it run until 4th iteration then stopped...can anybody help me? it did not give any error...
You're going to struggle to get someone to answer (let alone read) this question. I would suggest using the debugger to step ...

mer än 12 år ago | 0

Answered
Output of mod() for large input
@Walter Roberson is correct, in R2012a MATLAB automatically casts the number into a |uint64|. For this piece of code [mod(2...

mer än 12 år ago | 0

| accepted

Answered
surface integral of discrete data
Sorry, I read your question too fast and pointed you to code for surface *area*, not surface integral. In this case it's even ea...

mer än 12 år ago | 0

Answered
How can I solve this linear System?
And another way (which could be chained into a very long one-liner). First, assuming you have the following test data: % Te...

mer än 12 år ago | 2

Answered
'closeness' of multiple vectors
Is closeness a measure of how many entries match in matching positions? In this case: closeness = @(x, y) nnz(x == y) / num...

mer än 12 år ago | 0

| accepted

Answered
How to assign parts of a matrix equal to a single vector
It's because |y(2:4, 2:4)| is a 3x3 matrix, and so you must assign it a 3x3 matrix. The command |repmat| is an easy way to stack...

mer än 12 år ago | 0

| accepted

Answered
Additional ODE solvers in Matlab?
You could try sundials <https://computation.llnl.gov/casc/sundials/main.html>, they have a suite of good solvers and provide a M...

mer än 12 år ago | 0

| accepted

Answered
How to replace some of the value in the matrix with NaN?
This is another one of these problems where the simplest way to solve it is to randomly generate candidates until you find one t...

mer än 12 år ago | 0

Answered
runge-kutta
I'll give you the high level overview, you'll need to write the code though # Turn it into a system of two first order equati...

mer än 12 år ago | 3

Answered
surface integral of discrete data
This came up recently -- in this thread there is code for computing the surface area based on dividing a regular mesh into trian...

mer än 12 år ago | 0

Answered
extracting a 2d plane from a 3d surface plot
How about contour(x, y, z1-z2, [0 0]) ?

mer än 12 år ago | 1

| accepted

Answered
How to "stretch" matrix
Further to Image Analyst's answer, you can do it without the image processing toolbox too (assuming m has an even number of entr...

mer än 12 år ago | 1

Answered
extracting a 2d plane from a 3d surface plot
Plotting the plane is pretty easy surf(x, y, zeros(size(x)) You can adjust colour, edgecolor, transparency etc if you wa...

mer än 12 år ago | 0

Answered
Strange problem - vector dimensions
My guess is that there is a variable called 'A' in your 7th m-file. What if you call your array AAA (to avoid naming conflicts) ...

mer än 12 år ago | 1

| accepted

Answered
Help with finding and plotting interpolating polynomials
I presume you mean c0 + c1x + c2x^2 + c3x^3 + c4 x^4 + c5 x^5 The system of equations method means treating c0 ... c5 as unkn...

mer än 12 år ago | 0

Answered
How to sample from custom 2D distribution?
A really basic, quick to code (but darned inefficient way) is to generate uniform samples in the 3D volume defined by the x and ...

mer än 12 år ago | 1

Load more