Answered
how to set 1000 separator for large numbers in GUI MATLAB
import java.text.* v = DecimalFormat; in = 123456789; out = char(v.format(in)) Taken from here: <http://w...

15 years ago | 1

Answered
How do I create a Filter that takes out irrelevant data?
The curve fitting toolbox can help you deal with irregular data. Here I make a noisy surface, approximate it using polynomials, ...

15 years ago | 1

| accepted

Answered
correctly erasing items from a listbox
After you delete the items from the 'String' property, you need to update the 'Value' property as well. For example, if you i...

15 years ago | 1

| accepted

Answered
Producing a Matrix
*FAST:* [Xa, Xb]=meshgrid(X); [Ya, Yb]=meshgrid(Y); [Za, Zb]=meshgrid(Z); D = sqrt((Xa-Xb).^2+(Ya-Yb).^2+(Za-Zb).^2); ...

15 years ago | 1

| accepted

Answered
Thresholds in ODE solvers
Make your expdecay look something like this: dn= zeros(1,1); dn= -0.1*x; dead = x < 10; assignin('caller','dea...

15 years ago | 1

| accepted

Answered
Multiplying values in one column with values in another, depending on criteria
One way to do it: sum( A(:,2) .* A(:,5) .* (A(:,4) >= 0.8) )

15 years ago | 0

| accepted

Answered
Logical Indexing for a slice of a 3D-Matrix
After just trying it out of curiousity, I find that a simple FOR loop actually works better than all of these vectorized solutio...

15 years ago | 0

Answered
Logical Indexing for a slice of a 3D-Matrix
Probably a bit faster: IDX = cast(MyMat1>5,class(MyMat1)); MyMat2(:,:,2) = MyMat1.*IDX+MyMat2(:,:,2).*(1-IDX);

15 years ago | 0

Answered
Which functions are not supportet by deploytool?
You can find what you are looking for here: <http://www.mathworks.com/products/compiler/compiler_support.html> By the way,...

15 years ago | 0

| accepted

Answered
FFT result does not jive with theory for basic sine and cosine
There is absolutely nothing strange here.The discrete fourier transform assumes *PERIODIC SIGNALS*. In your case: t=[-50:50]...

15 years ago | 7

| accepted

Answered
Solving Second Order Differential Equations with Discrete Time Data
Could you define a function that is the interpolation of your discrete data points F(t)? Fi = @(ti) interp1(t,F,ti) This...

15 years ago | 0

Answered
Image Processing: Array Problem - right justify?!
For the first part, you can use the keyword "end" A = zeros(5); A(1,end) = 4; A(2,end-2:end) = [1 2 3]; A(3,end-4:...

15 years ago | 1

Answered
Simple Integration
QUADGK works better for integrals that go to infinity: syms c L; first = int( exp(-(L-3)^2/2), c, Inf); second = matl...

15 years ago | 0

| accepted

Answered
Replacing 1s in a sparse matrix by a random int.
If "A" is your sparse matrix, then: A(find(A)) = randi(maxweight,nnz(A),1); will replace every element with a random i...

15 years ago | 0

Answered
[Solved] Power method, eigenvalues.
Simple power iteration only works when there is a single dominant eigenvalue. The matrix A =[ 0 -0.3333 -0.3333 ...

15 years ago | 3

| accepted

Answered
fill
Just for fun, and because windowbuttonmotionfcns are totally underappreciated: t = (1/16:1/8:1)'*2*pi; x = sin(t); y ...

15 years ago | 2

Answered
finite differences scheme
Here is an example: Solve t*y' + (1+sin(t))*y = cos(t) y(0) = 1, using first order finite differences N = 2000; t ...

15 years ago | 0

Answered
Create plot with specified handle?
No. But you can specify a "tag" of "32", and then use that to refer to the object using FINDOBJ. For example: figure ...

15 years ago | 2

| accepted

Answered
create array
Paulo's algorithm without a loop: a=zeros(3,6624); a(1:2,:)=rand(2,6624)/3; a(3,:)=1-sum(a); P = randperm(66...

15 years ago | 0

Answered
Figure Editor: how to change default settings?
One MATLAB has its colordef as black. colordef black figure fplot('x.^2',[0 1]) colordef white figure ...

15 years ago | 0

| accepted

Answered
how to create 4x4 inverse matrix in simulink?
DSP System Toolbox (Signal Processing Blockset if you're not using the latest version R2011a) -> Math Functions -> Matrices and ...

15 years ago | 0

Answered
ode45 - Plotting temporarily calculated quantity
If you are creating T inside diffEq somewhere, then you could just as easily create T again after the solver is all done. In ot...

15 years ago | 0

Answered
while loop, index out of bounds
If Deltaf is really a vector, not a 2D matrix, then what you are doing will work fine once you take out the unnecessary colons. ...

15 years ago | 0

Answered
For with Break
Seems like you've got the right idea: for n=1:100 disp(n) if n == 7 disp('Hello everybody') b...

15 years ago | 1

| accepted

Answered
Reading csv file and formating timestamp
*Part a) timestamp - remove the year and day and keep the hr:min:sec.sec. eventually convert this to seconds* Once you run this...

15 years ago | 1

| accepted

Answered
interp1 problem
Are you trying to find the value of rho given that T=275? rho=[1.4133,1.3587,1.2614,1.1769,1.1032]; T=[250,260,280,300...

15 years ago | 0

Answered
" Sumif" type Aggregation/Consolidation along one dimesion of a 3d matrix
Scaling your 1-D Version up to a 3-D one: Asum = zeros([size(A(:,:,1)) max(X)]); for n = 1:max(X) Asum(:,:,n) =...

15 years ago | 1

Answered
Solving non linear system of equations
Wow. Now this is really like finding a needle in a haystack. But FMINSEARCH can find it if you just give it a better starting...

15 years ago | 1

Answered
Need help using colon operator with multiple matrices - I'm really close to being loopless!
If you know that it's going to end up being a rectangular matrix like in your example, then the (b-a) all have to be the same: ...

15 years ago | 2

Answered
binary to decimal conversion.......need ans immidiately plzzzzzzzzzzz
sum(bsxfun(@times,reshape(A,8,[]), 2.^(7:-1:0)'))

15 years ago | 3

| accepted

Load more