답변 있음
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...

거의 10년 전 | 0

답변 있음
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 ...

거의 10년 전 | 0

답변 있음
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...

거의 10년 전 | 1

답변 있음
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...

거의 10년 전 | 0

답변 있음
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...

거의 10년 전 | 0

답변 있음
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...

거의 10년 전 | 1

답변 있음
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?

대략 10년 전 | 1

답변 있음
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...

대략 10년 전 | 4

질문


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

대략 10년 전 | 답변 수: 6 | 2

6

답변

답변 있음
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, ...

대략 10년 전 | 1

답변 있음
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...

대략 10년 전 | 2

답변 있음
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...

대략 10년 전 | 0

답변 있음
I want to find the non-zero numbers in each row
help find

대략 10년 전 | 0

답변 있음
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...

대략 10년 전 | 0

답변 있음
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. ...

대략 10년 전 | 2

답변 있음
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,':',',')

대략 10년 전 | 0

답변 있음
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...

대략 10년 전 | 0

답변 있음
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 ...

대략 10년 전 | 1

| 수락됨

답변 있음
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 ...

대략 10년 전 | 1

답변 있음
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...

대략 10년 전 | 0

답변 있음
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...

대략 10년 전 | 0

답변 있음
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.-') ...

대략 10년 전 | 1

| 수락됨

답변 있음
Replace elements of sparse matrix from a full matrix.
What don't you replace the elements before converting it?

대략 10년 전 | 0

답변 있음
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...

대략 10년 전 | 1

| 수락됨

답변 있음
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*

대략 10년 전 | 0

| 수락됨

답변 있음
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...

대략 10년 전 | 0

| 수락됨

답변 있음
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...

대략 10년 전 | 0

답변 있음
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...

대략 10년 전 | 0

| 수락됨

답변 있음
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...

대략 10년 전 | 1

더 보기