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

fast 14 Jahre vor | 1

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 1

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

fast 14 Jahre vor | 2

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 2

| akzeptiert

Beantwortet
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: ...

fast 14 Jahre vor | 2

| akzeptiert

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

fast 14 Jahre vor | 2

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 1

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

fast 14 Jahre vor | 1

| akzeptiert

Beantwortet
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: ...

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 1

Beantwortet
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); ...

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

| akzeptiert

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 0

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

fast 14 Jahre vor | 3

| akzeptiert

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

etwa 14 Jahre vor | 1

| akzeptiert

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

etwa 14 Jahre vor | 0

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

etwa 14 Jahre vor | 1

| akzeptiert

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

etwa 14 Jahre vor | 0

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

etwa 14 Jahre vor | 0

| akzeptiert

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

etwa 14 Jahre vor | 0

| akzeptiert

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

etwa 14 Jahre vor | 1

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

etwa 14 Jahre vor | 0

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

etwa 14 Jahre vor | 0

| akzeptiert

Beantwortet
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>

etwa 14 Jahre vor | 4

Mehr laden