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

mer än 11 år ago | 0

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

mer än 11 år ago | 0

| accepted

Answered
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' * (...

mer än 11 år ago | 0

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

mer än 11 år ago | 0

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

mer än 11 år ago | 0

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

mer än 11 år ago | 0

| accepted

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

mer än 11 år ago | 1

| accepted

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

mer än 11 år ago | 1

| accepted

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

mer än 11 år ago | 1

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

mer än 11 år ago | 6

| accepted

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

mer än 11 år ago | 3

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

mer än 11 år ago | 0

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

mer än 11 år ago | 0

| accepted

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

mer än 11 år ago | 0

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

mer än 11 år ago | 0

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

mer än 11 år ago | 0

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

mer än 11 år ago | 0

Answered
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)),:)=...

mer än 11 år ago | 1

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

mer än 11 år ago | 1

| accepted

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

mer än 11 år ago | 0

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

mer än 11 år ago | 2

| accepted

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

mer än 11 år ago | 0

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

mer än 11 år ago | 0

| accepted

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

mer än 11 år ago | 1

| accepted

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

mer än 11 år ago | 0

| accepted

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

mer än 11 år ago | 0

| accepted

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

mer än 11 år ago | 0

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

mer än 11 år ago | 1