Réponse apportée
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...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 1

Réponse apportée
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...

plus de 13 ans il y a | 2

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 2

| A accepté

Réponse apportée
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: ...

plus de 13 ans il y a | 2

| A accepté

Réponse apportée
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 ...

plus de 13 ans il y a | 2

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 0

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

plus de 13 ans il y a | 1

Réponse apportée
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...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
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: ...

plus de 13 ans il y a | 0

Réponse apportée
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 ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 1

Réponse apportée
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); ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
Quick way to change complex number into NaN
A(imag(A)~=0) = nan;

plus de 13 ans il y a | 3

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
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)

plus de 13 ans il y a | 0

Réponse apportée
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))

plus de 13 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
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 ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 13 ans il y a | 1

Réponse apportée
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...

plus de 13 ans il y a | 0

Réponse apportée
Adding matrix elements (entering matrices into other matrix)
How about: A(2:3,2:3) = A(2:3,2:3) + C

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
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>

plus de 13 ans il y a | 4

Charger plus