답변 있음
how to read a .txt file in matlab ?
Suppose that your file is called data.txt You can load the data simply with load('data.txt'); which will create a variabl...

12년 초과 전 | 0

답변 있음
patch question? image processing
How are you creating the patch? Is it only one patch? If you want the patches to be painted, you will need to create two patc...

12년 초과 전 | 0

| 수락됨

답변 있음
How to find the reverse of a permutation vector?
Notice that p = P * (1:4)' The same for pt, i.e. pt = P' * (1:4)' For vectors p of length N, just use: pt= P' * (...

12년 초과 전 | 0

답변 있음
How to supress a warning which does not have a corresponding warning ID.
Use warning('off','comm:obsolete:vxlib'); It may ask you to unlock the library first in a popup window, which you can do...

12년 초과 전 | 0

답변 있음
how to merge 2D and 3D plots with desired positioning
You can use *surf* as you did with the cylinder. You then might need to define the grid small enough and set the colours outside...

12년 초과 전 | 0

답변 있음
Selecting a subset of a larger matrix with criteria
Dear Noah, Suppose that A is your original matrix and B is the matrix you want to obtain. You could do something like this:...

12년 초과 전 | 0

| 수락됨

답변 있음
More efficient dot product function.
Are you using the function *dot(x,y)* ? If that's so, better use x'*y (assuming that x and y are column vectors) In my...

12년 초과 전 | 1

| 수락됨

답변 있음
Traversing Through a Vector of Different-sized Cells
Assuming that V =[20 40 10 20 5 10 30 15 25 35]; C ={ {1 2 3}; {5 2 3 1}; {3 4 2 1}; {1 ...

12년 초과 전 | 1

| 수락됨

답변 있음
How to make loops run faster
Try this for j=days_left_in_contract-1:-1:2, counter=days_left_in_contract-j; difference=min(counter,days_left_wi...

12년 초과 전 | 1

답변 있음
Can anyone tell me what is the difference between scatter and plot commands in Matlab?
scatter draws points without lines connecting them whereas plot may or may not plot the lines, depending on the arguments. sc...

12년 초과 전 | 6

| 수락됨

답변 있음
Preallocating memory for a matrix of unknown size
You can use a buffer. I mean, suppose the matrix you want is M, then create M=[]; and a vector X=zeros(xsize,2), where xsize is ...

12년 초과 전 | 3

답변 있음
How to solve "Index exceeds matrix dimensions" error?
At first glance, the error should appear as a consequence of the line Bdata_in = Bdata_s(1:NumBasei , :); So, I would re...

12년 초과 전 | 0

답변 있음
adjusting of axis X
Yes it is! First you need to make a vector b with the labels: b=arrayfun(@(x)num2str(x),a,'UniformOutput',false); Then,...

12년 초과 전 | 0

| 수락됨

답변 있음
How to run two dependent function simultaneously?
Dear Andrea, you might consider to check the post in http://www.mathworks.com/matlabcentral/answers/2081-how-to-execute-t...

12년 초과 전 | 0

답변 있음
How can i graph ponits with coord and value assigned, as colour graph
The result of patch depends on the patches you define, so at least using patch, there is no other way. What you can certainly...

12년 초과 전 | 0

답변 있음
How can i graph ponits with coord and value assigned, as colour graph
Have you taken a look at the command *patch* ? For example patch('Vertices',V,'Faces',F,'FaceVertexCData',D,'FaceColor','in...

12년 초과 전 | 0

답변 있음
reading whitespace in textscan
I can only think of two options: 1) Add spaces separating the fields in the data, i.e. instead of ddmmyyyyHHMM, modify the da...

12년 초과 전 | 0

답변 있음
Search and delete row from cell array
Suppose that C is your cell array Cnew=C; %Just for not losing original values Cnew(cellfun(@(x)isempty(x),C(:,6)),:)=...

12년 초과 전 | 1

답변 있음
Changing Axis in a GUI and Saving a figure in a GUI
Dear Rhys Taus, I might be wrong, but I think the problem is that you might be rewriting the axes instead of modifying them. ...

12년 초과 전 | 1

| 수락됨

답변 있음
What does rgb palette mean?
RGB means Red Green Blue, and rgb2gray needs an mx3 matrix because each column in that matrix represents red (first column), gre...

12년 초과 전 | 0

답변 있음
Multi-colored pop-up menu entries
Yes, try this: uicontrol('style','popup','string',{'<HTML><FONT COLOR="red" SIZE="10" FACE="ARIAL"><b><i>Here</i></b></HTML...

12년 초과 전 | 2

| 수락됨

답변 있음
plotting wind direction V/S time in months (timeseries)
Suppose you have the data in a matrix A, each row representing a measurement. The day would be in the first column and the direc...

12년 초과 전 | 0

답변 있음
Comparing user input and dataset to select appropiate value
How about using find after conversion to numeric value of the answer? ansnum=str2num(answer(1,1)); k=find(dataset==ansnum)...

12년 초과 전 | 0

| 수락됨

답변 있음
How to add one more column in dataset
I might not have understood your question, so please let me know if this does not answer it. Suppose that you have a dataset ...

12년 초과 전 | 1

| 수락됨

답변 있음
pop up menu and slider....
Hopefully this helps: 1) Save the handles of the ui elements. Suppose that hpopup and hslider are the handles of the pop up m...

12년 초과 전 | 0

| 수락됨

답변 있음
Counting numbers in a sequence while corrosponding to another sequence
You can do that using the following code A=[1 2 3 4 5 6 8 9 10 11 12 13 14]; B=[6 6 6 6 4 4 4 2 2 6 6 4 4]; C=d...

12년 초과 전 | 0

| 수락됨

답변 있음
how to create matrix iteration
You can use while as follows while any(A) end *any*(A) assumes first that all values of A can be converted to type *l...

12년 초과 전 | 0

답변 있음
Use convolution (conv) for probability distribution... ?
Dear Mats Lindqvist, I've found several possible explanations, so please check if anyone results to be your case: 1) As it...

12년 초과 전 | 1