Réponse apportée
Is there something like 'array colon'? in other words how can I apply colon operator to all the elements of an array (please read the text below so my question will make sense)?
A = [1 10 16 23]; u = reshape(bsxfun(@plus,A,(-3:2).'),1,[])

presque 14 ans il y a | 0

| A accepté

Réponse apportée
How to display answers using polyfit
How do you know the slop of the line before you do the fit? How noisy is the data? This seems to work: >> x = 0:1; y...

presque 14 ans il y a | 0

Réponse apportée
How to do indexing without moving to a new variable ?
As far as memory goes, if you are o.k. in making the temporary variable through the other methods suggested here then you are o....

presque 14 ans il y a | 3

Réponse apportée
How to fit legend inside a figure
Even with fontsize 1 the entries are not visible. I think you could make your own legend, but it would require a bit of HG fun ...

presque 14 ans il y a | 0

Réponse apportée
An equivalent to jump/goto ?
There has been a feature request for quite some time to allow BREAK to have a level passed to it. Perhaps add your name to the ...

presque 14 ans il y a | 1

Réponse apportée
y(t)=A1cos(200*pi*t)+A2sin(200*pi*t)
A1 = 3; A2 = 5; t = 0:1/(2*200*pi):pi/8; y = A1*cos(200*pi*t)+A2*sin(200*pi*t); plot(t,y) If you want to use an...

presque 14 ans il y a | 0

Réponse apportée
systematic: Do not use global, don't use eval
EVAL is evil: Experience! Not just my own experience. Many times on CSSM and even here on answers a user asks, "How can I cre...

presque 14 ans il y a | 8

| A accepté

Réponse apportée
How to erase data from a matrix from the command line?
M=[3 1.2 13 2 1.2 0.3 0.3 10 10 2 1 0 0.7 5 3 0.4]; Nij = M(all(diff(sort(M,2),[],2),2),:)

presque 14 ans il y a | 1

| A accepté

Réponse apportée
if statement between cells arrays
This will fix your code: for i=1:length(p) if p{i}~=c{i} level1_root=p{i} break ...

presque 14 ans il y a | 0

Réponse apportée
Search folders/paths with strfind: how to do excluding search?
You could just leave out the call to NOT in Index3.

presque 14 ans il y a | 1

| A accepté

Réponse apportée
How to create a matrix from given vectors
Here is the obligatory one liner. It works whether or not A has a zero. D = cumsum(ones(max(A),length(A))) <= A(ones(1,m...

presque 14 ans il y a | 1

Réponse apportée
Creating a symbolic variable, then using it as a real variable
syms x y = input('Please enter a valid function of x: ') deriv = diff(y) % This will be symbolic x = 0:pi/30:pi;...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
remove rows that contain zeros from cells array in matlab
m(cellfun(@(x) ~x(1),m(:,1)),:) = []

presque 14 ans il y a | 2

| A accepté

Réponse apportée
WHILE LOOP program does not work
You do not increment i or j inside the loops. i =i+1; etc. Thus i will always be less than m, and j less than n.

presque 14 ans il y a | 0

Réponse apportée
How can I use randperm.m to convert one matrix to another?
% Say we are given this: A = randi(100,4,8); % Now the method: [m,n] = size(A); B = bsxfun(@(x,y) A(y,randperm(x...

presque 14 ans il y a | 0

Réponse apportée
how to tabulate this results using fprintf?
Give some example values for your data... Here is a generic example on how to make nice tabulations: x = rand(5,1); ...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
Why is this wrong??
I run your code and it plots 6 lines. check for yourself: >> length(findobj('type','line')) ans = 6 ...

presque 14 ans il y a | 0

Réponse apportée
How to solve the following questions?
Your system is equivalent to: [2 3;2 3;2 3]*[x;y] = [-23;-19;-15] What makes you think this has a solution?

presque 14 ans il y a | 0

Réponse apportée
extract seconds from timestamp in cell
Say your cell array looks like: T = {'2011-04-19T01:01:59.000Z';... '2011-05-19T01:21:02.000Z';... '2011-...

presque 14 ans il y a | 1

Réponse apportée
fprintf %E Leading zero
Here is another: F = @(x)regexprep(sprintf('%13.6E\n',x*10),'(\d)(\.)(.*)','0$2$1$3')

presque 14 ans il y a | 0

Réponse apportée
Cell contents assignment to a non-cell array object, hdf data
Just access each element of the cell array whenever you need to access one of the arrays, C{1} = magic(3); % Sample cell a...

presque 14 ans il y a | 0

Réponse apportée
Does sin() have an error?
That _is_ the correct value for <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F f...

presque 14 ans il y a | 1

| A accepté

Réponse apportée
Binary String to ASCII
How did you do it? This seems to work. M = 'Hello'; % Now encode: Mbinlong = reshape(dec2bin(double(M),7).',[],1) ...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
how to concatenate different cells of a cell array in one cell without a loup ??
B = {{magic(2) magic(2)},{magic(2) magic(2) magic(2)}} B2 = cat(2,B{:})

presque 14 ans il y a | 0

| A accepté

Réponse apportée
trouble using "mean" function in MATLAB?
You are creating a vector with the elements of A, rather than indexing into A with a vector. Look at what happens: A = [...

presque 14 ans il y a | 1

Réponse apportée
General questions about function and if command.
For the first question, it makes a difference how and where you are accessing the variables. Post a simple example for anlaysis...

presque 14 ans il y a | 0

Réponse apportée
Help with looping problem
Why would you want to create 64 variables like that? What a mess it would be to deal with in further steps. Perhaps two cell a...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Please do not use this awful construct to find the global minimum: MinInput = min(min(I)); % This is the cause of your pr...

presque 14 ans il y a | 0

Réponse apportée
Create diagram where y axis has zero limits two times (-1 to 0,0 to 0,0 to 1)
This will get you started. I include most of the properties you will need to make it look right. You should look at the other ...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
Why is my GUI Slider dissapearing when I set it's position?!
Actually it is there, at the default position. The usual way of initializing a uicontrol is to pass all properties at once: ...

presque 14 ans il y a | 0

| A accepté

Charger plus