Réponse apportée
Y-axis lim with Bar/Line overlay
figure; h_bar = bar(_data(:,1),Y); set(gca, 'XTick',_data(:,1)); set(gca, 'XTickLabel', _data(:,1)); h1 = gca; ...

plus de 14 ans il y a | 0

Réponse apportée
match a number (date) in a matrix - Matlab
I don't think there's a completely vectorized solution, but this is close: d = datenum(bsxfun(@minus,datevec(lastDay(:,2)),[0...

plus de 14 ans il y a | 0

Réponse apportée
Listing files in an arbitrarily named and deep tree
Looks like you're on a Windows system, so try: [~,flist] = system('dir *.avi /B/S') You may want to |cellstr| the result. *...

plus de 14 ans il y a | 0

Réponse apportée
Numerical Integration with functions as borders
You could do this as an iterated integral using |quad| (twice). Hooray for Fubini's Theorem! Here's the volume of a hemisphere...

plus de 14 ans il y a | 0

Réponse apportée
RK4 in MatLab Help!
Ahhh the classic problem. A few things I notice: # Your |vexact| is, I assume, supposed to evaluate the exact solution. In ...

plus de 14 ans il y a | 0

Réponse apportée
Fitting two sets of data to one function simultaneously
I think a simple |fminsearch| might be easier in this case. You'll have to figure out how you want to define your total error t...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
writing mfile using a mfile
You can programmatically interact with the MATLAB Editor using the API introduced in R2011a: http://blogs.mathworks.com/deskt...

plus de 14 ans il y a | 0

Réponse apportée
Select matrix rows based on criteria
I can't quite work out the code (maybe the formatting is confusing me), but it sounds like what you're trying to do is this: ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
finding the distance between elements of a vector
OK, from what I can tell from your further input, I think this function does what you want. function d = xyspace(A,x,y) ...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Exponential Curve fitting
Looks a whole lot like a typical local-vs-global minimum issue. The minimum that |fminsearch| finds depends heavily on the init...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Displaying surface in XY plane
"I want to display it in XY plane" You mean as an image or contour map? In which case, use |imagesc| or |contour|. |doc con...

plus de 14 ans il y a | 0

Réponse apportée
How to select 2nd largest number (or largest if no 2nd largest)
Is it possible to have repeated values? If so, what do you define as the "second largest" value? Eg |secondmax([1 2 3 3]) = 2|...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
MATLAB GUI Popup Menu
Here's an example that I think is similar to what you're trying to do. It sounds like you're using GUIDE, in which case use the...

plus de 14 ans il y a | 1

| A accepté

Réponse apportée
finding the distance between elements of a vector
Do you know that you'll always have pairs? That is, could you ever have a vector |[0 2 0 -3 0 5 0 -2 0 0 3 0 0 0 0 2 0 -5]| or ...

plus de 14 ans il y a | 0

Réponse apportée
Anonymous Function Differentiation Problem?
If you know the independent variable is called 'x': fprime = str2func(['@(x) ',char(diff(sym(regexprep(char(f),'^@\(x\)',''...

plus de 14 ans il y a | 1

Réponse apportée
Graphing a linear regression line from given points, very simple example, having trouble with matrices dimensions?
% Enter t=dataC and y=dataABS as columnwise vectors And then you enter them as rows :) Stick a transpose ( |'| ) on those th...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Solutions using ODE with different initial conditions
As well as Walter's solution, you can also simply specify fixed timesteps for |ode45| to use: tvals = % make a vector of ti...

plus de 14 ans il y a | 1

Réponse apportée
Simple Interpolation with interp1
I'm guessing that you're passing the entire arrays (ie NaNs and all) into |interp1|. For cubic interpolation, |interp1| calls |...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
very basic matlab question about .dat file
The statement of the problem seems ill-formed to me. How are these variables being "measured"? I could see reading in *from* a f...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
how to halt the program?
ctrl-C?

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
Store as array not variable
The classic trap! c1 = b^2*(((exp(a*2*pi)-cosh(a*b*T0))/sinh(a*b*T0))^2-1); The divide there will be interpreted as a ma...

plus de 14 ans il y a | 0

| A accepté

Réponse apportée
simple quastion about randn and mean of random noise
|n = randn(1000,1)| creates a *vector* (1000-by-1), so |sum(n)| is the sum of the thousand random numbers. Taking the mean is t...

plus de 14 ans il y a | 0

Réponse apportée
Minimization of function. Plz Help.
R = [1 2 3;4 5 6;7 8 9]; [row,cols] = size(R); f = ones(1,cols); fobj = @(x) growth(R,x); opts = optimset('A...

plus de 14 ans il y a | 0

Réponse apportée
fminsearch with output constraint
But by definition |fminsearch| is an unconstrained method, so you can't provide a constraint. If there's some reason you can't ...

plus de 14 ans il y a | 0

Réponse apportée
Stock time interval conversion
Do you want to index or do you want to interpolate? Given that you don't necessarily have data for the values you want (every f...

plus de 14 ans il y a | 0

Réponse apportée
Appending to a saved dataset
If it just comes down to "I'd like to be able to append to the exported dataset instead", then here's one way to do it, but it's...

presque 15 ans il y a | 0

Réponse apportée
??? Error using ==> mldivide Matrix dimensions must agree.
Unless you actually want to do a matrix division, a simple solution is to do a find-n-replace: "/" -> "./" Otherwise, please ...

presque 15 ans il y a | 0

Réponse apportée
Is there a reason MuPad doesn't find the obvious cancellation?
I'm guessing it's something to do with assumptions about squares and square roots, and maybe denominators. Wouldn't swear to it...

presque 15 ans il y a | 1

| A accepté

Réponse apportée
Black pixels to white
x = imread('street1.jpg'); figure image(x) idx = all(x==0,3); x(repmat(idx,[1,1,3]))=255; figure image(x) ...

presque 15 ans il y a | 0

Réponse apportée
Faster than ODE45
|ode23tb| is more efficient for cruder tolerances, so make sure you use |odeset| to set the tolerances appropriately. |RelTol| ...

presque 15 ans il y a | 0

| A accepté

Charger plus