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

plus de 13 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 ...

plus de 13 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 ...

plus de 13 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...

plus de 13 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...

plus de 13 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),:)

plus de 13 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 ...

plus de 13 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.

plus de 13 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...

plus de 13 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;...

plus de 13 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)),:) = []

plus de 13 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.

plus de 13 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...

plus de 13 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); ...

plus de 13 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 ...

plus de 13 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?

plus de 13 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-...

plus de 13 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')

plus de 13 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...

plus de 13 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...

plus de 13 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) ...

plus de 13 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{:})

plus de 13 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 = [...

plus de 13 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...

plus de 13 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...

plus de 13 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...

plus de 13 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 ...

plus de 13 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: ...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
Matrix must be square
Did you mean to take the element-by-element power of the arrays? Look at the difference: x = magic(2) % A 2-by-2 matri...

plus de 13 ans il y a | 0

| A accepté

Réponse apportée
how to solve such transcendental equation?
There are several ways to go about this. One is to use FZERO. Since you didn't actually give the values for the constants, I'l...

plus de 13 ans il y a | 1

Charger plus