Réponse apportée
compute force matrix from positions matrix
There surely is way to vectorise your code, using bsxfun, accumarray and/or arrayfun, for instance. However, this most likely t...

environ 10 ans il y a | 0

Réponse apportée
i have a code which is written in 2006.the author's name is Xiang Bai .code dose not run. i cant find the problem. so i attached the code and the error message.can anyone help me? i really need help.
This errors arise when the classes of two variables differ. a = uint32(4) b = int8(4) a-b You can try to cast the ...

environ 10 ans il y a | 0

Réponse apportée
Please help! Combine figures into one new figure
Take a look at copyobj figure(1) subplot(1,2,1) ; ph{1} = plot(cumsum(rand(10,20)),'bo') ; figure(2) ax = subp...

environ 10 ans il y a | 1

Réponse apportée
Plot 10 times and take the average
users = [10 20 30 40 50]; N = numel(users) ; rates = zeros(1,N) ; % pre_allocation for i = 1 : N tempV = My...

environ 10 ans il y a | 0

Réponse apportée
Do you have a suggestion for a name of my function?
Thanks all! Nice to see, you all agree that RUN (or boat) should be part of the function name. I'll use runindex as the function...

environ 10 ans il y a | 0

Réponse apportée
array length is not what I've set...
In your code, the variable *j* has two roles: # an index into Hopt # a value that is used for calculation (angle?) Your b...

environ 10 ans il y a | 1

Réponse apportée
Do you have a suggestion for a name of my function?
Thanks for the inspiration! What about *runindex*? Or is this confusing with regard to existing functions?

environ 10 ans il y a | 1

Réponse apportée
what is the fastest way to convert a cell array of delimited numbers into a matrix
A = {'1,5012,0,35,6' ; '2,395,1,35,8'} ; A = repmat(A,250000,1) ; % big array! tic ; A2 = strcat(A,',') ; V = ssca...

environ 10 ans il y a | 4

Question


Do you have a suggestion for a name of my function?
I have written a nice little function which I would like to put on the File Exchange. However, I am still looking for a short an...

environ 10 ans il y a | 6 réponses | 2

6

réponses

Réponse apportée
How do I rename fields of a structure array?
You can use DEAL and a for-loop to change fieldnames: % create a structure array, with different fields for k=1:10, ...

environ 10 ans il y a | 1

Réponse apportée
How do I rename fields of a structure array?
There is a somewhat hidden function called *renameStructField*, that can do the job, perhaps within a loop. Or use dynamic fi...

environ 10 ans il y a | 2

Réponse apportée
how to create random numbers according to any distribution within a range
First, carefully read the help of RAND, especially the first example in it. The next step is to define your distribution more...

environ 10 ans il y a | 0

Réponse apportée
I want to find the non-zero numbers in each row
help find

environ 10 ans il y a | 0

Réponse apportée
Operands to the && operators must be convertible to logical scalar values.
Perhaps this example can help you in how to use logical operators with vectors: x = randn(1,20) y = randn(1,20) t...

environ 10 ans il y a | 0

Réponse apportée
Any simple way to change a struct with fields of length "n" to a struct of length"n"?
This question clearly shows how _not_ thinking about your data management in the beginning will get you into trouble later on. ...

environ 10 ans il y a | 2

Réponse apportée
How to delete the colon's in a matrix?
Is the data stored as strings in a cell array? C = {'1,6:3','2,5:3','99,103:4'} C2 = strrep(C,':',',')

environ 10 ans il y a | 0

Réponse apportée
How to generate a matrix of all permutations of numbers ignoring repeats
Does this produce your result? Note that the matrices become too large very rapidly ... My function PERMPOS can be download...

environ 10 ans il y a | 0

Réponse apportée
I want to plot some thing like this picture how can i do this ?
Use *AXES* to create a new axis relative to the another axes x = 0:100 ; y = exp((x/50).^2)+rand(size(x)) ; % some data ...

environ 10 ans il y a | 1

| A accepté

Réponse apportée
Find exact time step
Let S be your vector of speeds, and T your time points % Determine, for each time point, is the subject running or not ...

environ 10 ans il y a | 1

Réponse apportée
problem with input names of vectors loaded in a function
Do not store your data like this. It is the contents of a variable that should change, not the name itself. In your case, you...

environ 10 ans il y a | 0

Réponse apportée
GUI Question: Have a pop-up dialog which has license agreement? Accept/Decline pushbuttons.
Sure! You can, for instance, use *QUESTDLG* for this: function Main disp('Welcome to this function.') ; ButtonNam...

environ 10 ans il y a | 0

Réponse apportée
How to change plotyn plot curve lines to stairs line
Can't you use *STAIRS*? An example: x = 0:.2:pi/2 ; y = sin(x) ; plot(x,y,'bo-') ; hold on ; stairs(x,y,'r.-') ...

environ 10 ans il y a | 1

| A accepté

Réponse apportée
Replace elements of sparse matrix from a full matrix.
What don't you replace the elements before converting it?

environ 10 ans il y a | 0

Réponse apportée
How can I get the Mastering Matlab Toolbox
Duane Hanselman retracted all the files from the Matlab File Exchange, but the book has its own website where you can download t...

environ 10 ans il y a | 1

| A accepté

Réponse apportée
The value of each iteration is not recorded in cell
You want to loop over several elements: *for k = 1:11* rather than *for k = 11*

environ 10 ans il y a | 0

| A accepté

Réponse apportée
How to generate 500 permutations of any vector length 20? I am getting error
To generate one permutation of y you can use randperm Y = [45 45 45 45 45 45 0 0 30 30 0 0 0 0 45 45 45 45 45 45]; R = r...

environ 10 ans il y a | 0

| A accepté

Réponse apportée
How do I avoid using for loop when I want to treat the rows of a matrix individually?
This will work for unique rows of A: B=[1 2 1 3;1 2 1 4;1 3 1 4;1 2 1 6;1 4 1 5;1 5 1 3;1 5 1 7]; A=[1 2;1 5]; D=[1 3...

environ 10 ans il y a | 0

Réponse apportée
How to restrict the range ?
I do not see why you need bsxfun for this. If X is your signal, this statement restricts X between -1 and 1 X = [0.5 1 2 -2...

environ 10 ans il y a | 0

| A accepté

Réponse apportée
How to extract a row of 2D cell array and store it in another 1D cell array?
As for any 2D array, each row of a 2D cell array has to have the same number of elements. I assume you meant to say that *each c...

environ 10 ans il y a | 1

Charger plus