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

más de 13 años hace | 3

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

más de 13 años hace | 0

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

más de 13 años hace | 1

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

más de 13 años hace | 0

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

más de 13 años hace | 8

| aceptada

Respondida
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),:)

más de 13 años hace | 1

| aceptada

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

más de 13 años hace | 0

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

más de 13 años hace | 1

| aceptada

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

más de 13 años hace | 1

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

más de 13 años hace | 0

| aceptada

Respondida
remove rows that contain zeros from cells array in matlab
m(cellfun(@(x) ~x(1),m(:,1)),:) = []

más de 13 años hace | 2

| aceptada

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

más de 13 años hace | 0

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

más de 13 años hace | 0

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

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 0

Respondida
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?

más de 13 años hace | 0

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

más de 13 años hace | 1

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

más de 13 años hace | 0

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

más de 13 años hace | 0

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

más de 13 años hace | 1

| aceptada

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

más de 13 años hace | 0

| aceptada

Respondida
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{:})

más de 13 años hace | 0

| aceptada

Respondida
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 = [...

más de 13 años hace | 1

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

más de 13 años hace | 0

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

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 0

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

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 0

| aceptada

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

más de 13 años hace | 1

Cargar más