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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 2

| aceptada

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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 0

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

casi 13 años hace | 1

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

casi 13 años hace | 2

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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 0

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

casi 13 años hace | 0

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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 1

| aceptada

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

casi 13 años hace | 1

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

casi 13 años hace | 0

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

casi 13 años hace | 0

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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 0

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

casi 13 años hace | 2

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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 0

| aceptada

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

casi 13 años hace | 0

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

casi 13 años hace | 3

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

casi 13 años hace | 0

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

casi 13 años hace | 1

| aceptada

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

casi 13 años hace | 1

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

casi 13 años hace | 0

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

casi 13 años hace | 1

| aceptada

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

casi 13 años hace | 0

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

casi 13 años hace | 1

Cargar más