Respondida
Changing Double to String Automatically in a Dataset Array
Here are two ways to do it: %% Method 1, using "containers.Map" ds = dataset([10;100;10;1000;100000;1;1;10000],'VarNames...

alrededor de 13 años hace | 1

| aceptada

Respondida
Matlab sometimes produce a covariance matrix error with non-postive semidefinite?
This is just caused by roundoff error. Since you know they really should be zero (and not small negative numbers), you can do th...

alrededor de 13 años hace | 0

Respondida
using zoom in and zoom out in gui Axes
If you make a GUI in GUIDE, by default the toolbar and menubar are hidden. You can make them visible by setting the 'MenuBar' an...

alrededor de 13 años hace | 1

Respondida
adding breakpoint to program slows it down a factor of 250x
Might I suggest using the KEYBOARD command? It's a bit simpler than setting up dbstops and trys and catches, and works just as f...

alrededor de 13 años hace | 2

Respondida
Undefined function 'times' for input arguments of type 'cell'.
When you use INPUTDLG to get input from the user, the result is stored as a string (text) in what is known as a cell array. It i...

alrededor de 13 años hace | 0

| aceptada

Respondida
Nested Numerical Integral in Matlab
Rather than trying to do it all in one expression, it's much simpler if you break it up into two parts. Step 1. Make the inne...

alrededor de 13 años hace | 2

| aceptada

Respondida
How to constantly update a plot off of a slider being pulled
I know what you are trying to do, I often want to do the same Save the following in a file and run it to see an example: ...

alrededor de 13 años hace | 2

| aceptada

Respondida
Comparing strings in cell arrays of different sizes *Most efficient*
How about using the ISMEMBER function? Cellarray_2(ismember(Cellarray_3,Cellarray_1)) ans = 1 10 34 ...

alrededor de 13 años hace | 2

| aceptada

Respondida
how to calculate the Guass function integral within a ellipsoid?
The INTEGRAL3 function can do this quite easily. For example, for a = 2 and b = 3, a = 2; b = 3; f = @(x,y,z) exp...

alrededor de 13 años hace | 0

Respondida
How to obtain statespace having two inputs from transfer function in matlab mfile
How about: s = tf('s'); G= (s^2+s+1)/(s^4+s^3+s^2 ); Gss = ss([G G]); Although I don't quite see the point i...

alrededor de 13 años hace | 0

Respondida
Bicubic Interpolation on Scattered Data
Do you have the Curve Fitting Toolbox installed? That does support 3rd order interpolation from scattered data points: F = ...

alrededor de 13 años hace | 1

Respondida
Nonlinear fit of segmented curve
It is no problem to fit piecewise curves in MATLAB using the Curve Fitting Toolbox. You can deal with piecewise functions by mul...

alrededor de 13 años hace | 1

| aceptada

Respondida
Descriptive Statistics Function for a Dataset Array
Perhaps you could write a simple routine using the DATASETFUN function to calculate all the stats you wanted? For example: ...

alrededor de 13 años hace | 0

Respondida
Extreme gain for low pass filter
I don't think that is a weird bug. That large value looks correct to me. The DC gain should = 1. In other words, if you plug ...

más de 13 años hace | 0

| aceptada

Respondida
ODE45 stop after all events have fired
One way of doing this would be to call the ODE solver repeatedly in a loop, until you find that all particles have set off event...

más de 13 años hace | 1

Respondida
linear interpolation of matrix.
This is a method that will preserve area. %Step 0. Just making some random data to work with... R = rand(2209,32); ...

más de 13 años hace | 0

| aceptada

Respondida
How to set the default value for Edit Text in GUI ? If not input a number , I hope the contents auto changed to be '5'
STR2DOUBLE returns NaN for non-numeric data. Instead of checking for empty input using ISEMPTY, use ISNAN instead. if isnan...

más de 13 años hace | 0

| aceptada

Respondida
How do you create a surf plot in cylindrical coordinates?
You can use POL2CART to convert the data from r/theta to x/y and then call SURF. [R,TH] = ndgrid(0:0.1:5,linspace(0,2*pi,41...

más de 13 años hace | 0

Respondida
Area between a curve and a baseline
You could try something along the lines of this: % Just making some data x0 = 0:0.001:5; y0 = sin(x0); plot(x0...

más de 13 años hace | 0

Respondida
Quick way to change complex number into NaN
A(imag(A)~=0) = nan;

más de 13 años hace | 3

| aceptada

Respondida
i want to display binary image in blue color...
You can change the colormap to contain blue and white. Like this: I = im2bw(imread('cameraman.tif')); imshow(I) colo...

más de 13 años hace | 1

| aceptada

Respondida
Any way to stack histograms?
Can you use the 'stacked' option, as described in the help for BAR? bar(rand(10,5),'stacked'), colormap(cool)

más de 13 años hace | 0

Respondida
Matlab MODE-like function for evaluating multimodal sets of data?
One fairly simple way to do it: A = [1,2,3,3,5,2,7,7]; U = unique(A); H=histc(A,U); U(H==max(H))

más de 13 años hace | 1

| aceptada

Respondida
For loop Nested Loop
Why do you want to do this by brute force? You will have to test 12^11 combinations, which is quite a lot. I don't know what you...

más de 13 años hace | 0

Respondida
Vectorizing nested loops ---- indexing problem
The sorts of operations you are doing, where you sweep one vector through another, multiply and then add them, can be done very ...

más de 13 años hace | 0

| aceptada

Respondida
Do I need to add a column of ones on the predictor matrix for use in LinearModel.fit(X,y)
By default, LinearModel.fit also includes a column of ones. For example X = rand(10,2); y = 3*X(:,1) + 4*X(:,2) + 5*X...

más de 13 años hace | 0

| aceptada

Respondida
Finding the roots of a function gotten from using ODE45
Not as painless as Matt's way, but possible a bit more robust, since it uses the ODE solver's internal zero-finding capabilities...

más de 13 años hace | 1

Respondida
I want to solve a sinus equation.
You're just forgetting the apostrophes solve('b*sin(c)=d*sin(x)') ans = asin((b*sin(c))/d) pi - asin((b*sin(c...

más de 13 años hace | 0

Respondida
Adding matrix elements (entering matrices into other matrix)
How about: A(2:3,2:3) = A(2:3,2:3) + C

más de 13 años hace | 0

| aceptada

Respondida
date for release of Matlab 2012b general release
There you go: <http://www.mathworks.com/index.html> <http://www.mathworks.com/products/matlab/whatsnew.html>

más de 13 años hace | 4

Cargar más