Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

| accettato

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

| accettato

Risposto

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

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

oltre 11 anni fa | 1

| accettato

Risposto

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

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

oltre 11 anni fa | 1

| accettato

Risposto

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

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

oltre 11 anni fa | 1

Risposto

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

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

oltre 11 anni fa | 6

| accettato

Risposto

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

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

oltre 11 anni fa | 3

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

| accettato

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 1

Risposto

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

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

oltre 11 anni fa | 1

| accettato

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 2

| accettato

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 0

| accettato

Risposto

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

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

oltre 11 anni fa | 1

| accettato

Risposto

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

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

oltre 11 anni fa | 0

| accettato

Risposto

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

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

oltre 11 anni fa | 0

| accettato

Risposto

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

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

oltre 11 anni fa | 0

Risposto

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

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

oltre 11 anni fa | 1