Réponse apportée
How to change the number of digits over 15.
digits = 40; % Only works if you have the symbolic toolbox But this only applies to symbolic variables. You cannot get mo...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
Best way to rename a loaded variable?
Say you have the name of your variable: VAR = 'S'; Now you want to load that variable, but with the name T. This method...

presque 14 ans il y a | 21

| A accepté

Réponse apportée
How to remove a value from a vectort and revaluate it?
There is no need to pre-allocate M, as M is not built in a FOR loop. You are just overwriting the pre-allocation in one call, s...

presque 14 ans il y a | 0

Réponse apportée
Plotting with different colored markers
You can set the linestyleorder. clf set(gca,'linestyleorder',{'-',':','-.','--'},... 'colororder',[0 0 1;0 .5 0;1...

presque 14 ans il y a | 0

Réponse apportée
convert consecutive ones into alternating one/zero's
I would be surprised to find you could beat this loop: ii = 2; while ii<=length(A) if A(ii-1) && A(ii) ...

presque 14 ans il y a | 2

| A accepté

Réponse apportée
Plotting values from while loop results
a = 1; while a<=100 b(a) = 2*a; a = a+1; end plot(b) In general, the more MATLABish way to g...

presque 14 ans il y a | 0

Réponse apportée
turn 0 to 0.000
You cannot really change the underlying value too much. But as far as a display: A = [1.23,0,0.1011,5.1019,20.002]; f...

presque 14 ans il y a | 0

Réponse apportée
Generate Only a Specific Number of Combinations
There are several functions on the FEX that do something like this. For instance: <http://www.mathworks.com/matlabcentral/fi...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
question about the quiver
Set the scale to zero: quiver(0,0,1,1,0) % .......scale ^

presque 14 ans il y a | 0

Réponse apportée
Finding the row/column locations of 1s in a boolean matrix
A = rand(3)>.5; [I,J] = find(A) % I is the rows, J is the cols.

presque 14 ans il y a | 0

| A accepté

Réponse apportée
how to generate a polynomial
Sharen, please fill in the blank and define the ranges: P(m,n) = _________________________ (for m = 1:size(s,1) an...

presque 14 ans il y a | 0

Réponse apportée
Help vectorising for loop for kernel density
With these values for Y and y: Y = rand(10,1)*10; y = rand(5,1)*10; This gives the same result as your FOR loop: ...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
How can I sort data like this?
You need more than to simply call SORT. The SORT function sorts complex arrays *by magnitude*, which is a problem for an array ...

presque 14 ans il y a | 1

Réponse apportée
Ho to repeat a vector?
vec = 1:5; reshape(vec([1 1],:),1,[]) % Or reshape(vec(ones(1,N),:),1,[]) to expand N times For more complex expans...

presque 14 ans il y a | 1

Réponse apportée
Help with random in Matlab 2007b
Those functions *did not exist* in ver 2007b. Use this: % Create a random number drawn from 1 to 10 A = ceil(rand*10)...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
Help with infinite while loop
The problem is that ID never changes in your loop so you are just doing the same thing over and over. Change *all* 'out' variab...

presque 14 ans il y a | 0

Réponse apportée
Error using unique command
% Sort B the same way A is sorted. % We only need two calls to SORT. [~,J] = sort(A); BSA = sort(B); J(J) = 1:leng...

presque 14 ans il y a | 0

Réponse apportée
how do i split every digit of a string
S = '1234'; % Say this is your string.... num = S - '0'; num(1) num(2) num(3)

presque 14 ans il y a | 1

| A accepté

Réponse apportée
inputdlg to call a function on click ok
There are may ways to do this: P = {'Enter a number on [1,5]: '}; N = 'Input for ONES function.'; M = 1; D = {'3'}...

presque 14 ans il y a | 0

Réponse apportée
Can you help me to correct this error?
What are p and C? L = 60; Lr = L .* ones(3, 5); % No error...(the .* is not necessary) You have a variable named...

presque 14 ans il y a | 0

Réponse apportée
how to use while loop
Think about this for a second: share(m,n) is _initially positive_. Then you repeatedly divide it by 5 in the inner while loop....

presque 14 ans il y a | 0

Réponse apportée
Applying a constant function on a vector
You can specify the variable in your call to INLINE. For example, this works even if the user enters 2: f = vectorize(...

presque 14 ans il y a | 0

Réponse apportée
Differentiate an inline function
f = inline('x^8'); % Our inline function. D8 = diff(sym(f),8) % Find the 8th derivative D8 == prod(1:8) % Check. a...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
All possible combinations of 2 vectors.
Here is a solution: function H = mycomb(V) % Help L = length(V); H = cell(1,L); for ii = 1:L-1 C =...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
How to save -struct
According to the help for SAVE, you need to call like this: save(filename, '-struct', structName, fieldNames) Note tha...

presque 14 ans il y a | 2

Réponse apportée
Unwanted Tick Marks on second y-axis
set(AX(1),'ytick',[])

presque 14 ans il y a | 0

| A accepté

Réponse apportée
Getting 'Reference to non-existent field' Error
At the time you set the callbacks, those fields did not exist in the structure. As the very last line of your main function, pu...

presque 14 ans il y a | 0

| A accepté

Réponse apportée
combine elements of a large vector in matlab
>> tic, A = nchoosek(1:770,2); toc Elapsed time is 2.286846 seconds. >> tic, B = combnk(1:770,2); toc Elapsed time is...

presque 14 ans il y a | 1

| A accepté

Réponse apportée
How to draw plotmatrix in logscale?
AX = findobj('type','axes'); set(AX,'yscale','log','xscale','log')

presque 14 ans il y a | 1

| A accepté

Réponse apportée
List of builtin demo images
*UPDATED* To printe 2 columns instead of one. Even better for my command window (but not for this forum) is to print 3 columns...

presque 14 ans il y a | 8

| A accepté

Charger plus