Answered
if even/odd statement
Where are you stuck? What have you tried? . *EDIT* In response to your comment... IF statements don't select out portions ...

15 years ago | 2

| accepted

Answered
X.coords = something?
This creates a field in the structure y. This field is a cell array. Look at this: Y.myfield = 2; Y.yourfield = 3; Y ...

15 years ago | 1

| accepted

Answered
Matlab program help.
Generally, folks here will not do your homework for you. Please make an attempt at the code, and when you get stuck come back f...

15 years ago | 0

Answered
Finding the first 50 roots
I think the idea there was to incrementally search for the roots. If you need a certain number of roots, you could use a WHILE ...

15 years ago | 1

| accepted

Answered
Find an element of a matrix equal to a constant
If you are looking for the linear index: I = find(B==c); If you are looking for the subscript index: [I,J] = find(B==c); ...

15 years ago | 0

Answered
nest loop
Why do you think all aren't being calculated? Here is a modified version of your code, not changing the mechanics, which shows ...

15 years ago | 1

| accepted

Answered
Delete last 4 characters in a string variable
For example: S = 'Mystringname.txt' S = S(1:end-4)

15 years ago | 15

| accepted

Answered
Contributors metainfo: reputation and more
Congrats Walter for answering 1000 Questions!

15 years ago | 0

Answered
Minimum value with row index
If minba is not known before hand (the general case, and what it sounds like you want to have), then: ba = [52 15 52 44 44 ...

15 years ago | 2

Answered
Random matrix - Code efficiency
I would bet that your code is slow primarily because you did not pre-allocate the PoissonSauts array before the loops. Thus eve...

15 years ago | 0

Answered
Matrix reduction
If DAT is your original data. NewDAT = DAT(round(linspace(1,length(DAT),101)))

15 years ago | 2

| accepted

Answered
Remove some elements from a matrix but conserve the same struct
You will have to use cell arrays if you want to preserve the shape: X = num2cell(x); % A cell array with the same shape as...

15 years ago | 0

| accepted

Answered
try to find max and min of x and y for each cluster
One way to do this would be to use the ACCUMARRAY function. DAT = [608654.966062901 4820462.57604139 1 608662.0249...

15 years ago | 0

| accepted

Answered
How do I change the marker size with the zoom setting.
You can set an ActionPostCallback to execute after a zoom operation has completed. This is where you change the MarkerSize prop...

15 years ago | 1

Answered
expint not functioning as expected?
I think perhaps you are looking for this: Ei = @(x)real(-expint(-x)); x = -2:0.001:3; plot(x,Ei(x))

15 years ago | 0

| accepted

Answered
matrix to rgb conversion
The reason why you are having the problem is that when you call the ZEROS function, you are getting an array of *_doubles_*, whe...

15 years ago | 2

| accepted

Answered
How to call contents from an m file into GUI callback functions?
To run the M-file in the callback, just put the name of the M-file in the callback. For example: function pushbuttonca...

15 years ago | 2

Answered
Opening and writing to a text window with scroll bar.
You could certainly do this with a uicontrol object. I don't know how convenient it would be to do it this way, I guess it woul...

15 years ago | 3

| accepted

Answered
[Matrix] How to change data from double to cell
x=[33 33 33 44 33 22 11 22 11 11 11 11 33 22 33 22 33 33 22 11 22 22 22 11 11 22 22 11]; y = num2cell(x); y(x==11) = {'...

15 years ago | 1

| accepted

Answered
How do i loop this fuction and each time use a different AVI for processing
You could put the names of the files in a cell array then loop over the array. % This array stores the names of the files. ...

15 years ago | 1

| accepted

Answered
adding extra information in datacursormode text box
If you right click on the data cursor text, you can choose: Edit Text Update Function. In the function, put whatever you want....

15 years ago | 0

| accepted

Answered
Error "??? Attempted to access p(15); index must be a positive integer or logical."
In general, q will not be an integer. See the many discussions on <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28o...

15 years ago | 0

Answered
How to save a matrix as text file?
One way is to use FPRINTF. A = round(rand(6,7)*9) % Write this to file. fid = fopen('Mymatrix.txt','wt'); for ii = 1:...

15 years ago | 15

| accepted

Answered
Need Help Urgent!!!!!!!!!!!!
You did not completely clarify, but here is a non-vectorized code that will do part of the job. Note that for this problem, it ...

15 years ago | 1

| accepted

Answered
How to subtract each column of a matrix by the respective median of that column?
I_minus_med = bsxfun(@minus,I,median(I))

15 years ago | 5

| accepted

Question


How do I reset the "UntitledN" editor counter?
When I am using the editor and hit ctrl+n, a new file tab opens up with a default name UntitledN, where N is the number of times...

15 years ago | 1 answer | 0

1

answer

Answered
What is your favorite MATLAB related spam email?
Sir, Please consider that problem. a) Write a Matlab function that produces a fourth-order accurate Lagrange interpolatio...

15 years ago | 1

| accepted

Answered
removing outliers
What form is the data? You might be able to use logical indexing. For example: % x is some data with outliers 99 and -70. ...

15 years ago | 0

Answered
to form a single 3 D matrix using three different matrices
If your matrices are named A, B and C, then: D = cat(3,A,B,C);

15 years ago | 0

| accepted

Answered
Extrapolation 2-D lookup table
I don't know what kind of extrapolation is done in Simulink, but have you looked on the FEX? This might help, for example: <...

15 years ago | 0

Load more