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

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 2

| 已接受

已回答
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...

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 0

已回答
How to create non-repetitive random integers
randperm(100, 70)

13 years 前 | 1

已回答
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 ...

13 years 前 | 2

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

13 years 前 | 0

| 已接受

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

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 0

已回答
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 ...

13 years 前 | 0

已回答
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...

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 1

| 已接受

已回答
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))

13 years 前 | 1

已回答
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.

13 years 前 | 0

已回答
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 ...

13 years 前 | 0

已回答
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...

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 0

已回答
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...

13 years 前 | 2

已回答
'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...

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 0

| 已接受

已回答
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...

13 years 前 | 0

已回答
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...

13 years 前 | 3

已回答
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...

13 years 前 | 0

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

13 years 前 | 1

| 已接受

已回答
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...

13 years 前 | 1

已回答
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...

13 years 前 | 0

已回答
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) ...

13 years 前 | 1

| 已接受

已回答
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...

13 years 前 | 0

已回答
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 ...

13 years 前 | 1

加载更多