Answered

What does the value s do in my code??

This code is... a bit muddled. At the end of the day, the |s| is not really necessary. The problem you were having before with t...

What does the value s do in my code??

This code is... a bit muddled. At the end of the day, the |s| is not really necessary. The problem you were having before with t...

9 years ago | 0

Answered

problem with overwritten data when auto saving

I'm not entirely clear on what the crux of the problem is. Are you trying to loop through the directories (nr, nr2, nr3) and wan...

problem with overwritten data when auto saving

I'm not entirely clear on what the crux of the problem is. Are you trying to loop through the directories (nr, nr2, nr3) and wan...

9 years ago | 0

| accepted

Answered

I am a beginner using figures and uicontrol

Your |button_callback| function declaration line is commented out, so you literally have an |Undefined function 'button_callback...

I am a beginner using figures and uicontrol

Your |button_callback| function declaration line is commented out, so you literally have an |Undefined function 'button_callback...

9 years ago | 0

Answered

MATLAB GUI error when filling textboxes with data from file

Try using cell indexing in these lines: set(handles.hostbox, 'String', A(1)) set(handles.usernamebox, 'String', A(2)) ...

MATLAB GUI error when filling textboxes with data from file

Try using cell indexing in these lines: set(handles.hostbox, 'String', A(1)) set(handles.usernamebox, 'String', A(2)) ...

9 years ago | 0

| accepted

Answered

How can I find the peaks of a cfit object?

|test.coefs| is giving you the coefficients of the cubic splines that make up the fit. If I interpret your intention correctly,...

How can I find the peaks of a cfit object?

|test.coefs| is giving you the coefficients of the cubic splines that make up the fit. If I interpret your intention correctly,...

9 years ago | 2

| accepted

Answered

how to take out extreme event annually from the data.

Slightly new approach, given your comment on the previous answer. This one creates |hr|, |vhr|, and |ehr|, which are 20-by-22-b...

how to take out extreme event annually from the data.

Slightly new approach, given your comment on the previous answer. This one creates |hr|, |vhr|, and |ehr|, which are 20-by-22-b...

9 years ago | 0

| accepted

Answered

Help with creating new column inside a matrix with new data.

It looks like you have to pad with 0 to get 63 full days (you have 62 days + 23 hours), so why not just do that at the beginning...

Help with creating new column inside a matrix with new data.

It looks like you have to pad with 0 to get 63 full days (you have 62 days + 23 hours), so why not just do that at the beginning...

9 years ago | 0

| accepted

Answered

how to take out extreme event annually from the data.

The |reshape| function is going to be your friend here. I think I've interpreted your intention correctly, in which case, your ...

how to take out extreme event annually from the data.

The |reshape| function is going to be your friend here. I think I've interpreted your intention correctly, in which case, your ...

9 years ago | 0

Answered

How to evaluate my integral

Hard to say what's causing the error without seeing the actual MATLAB code you used. But regardless, if you just want the numer...

How to evaluate my integral

Hard to say what's causing the error without seeing the actual MATLAB code you used. But regardless, if you just want the numer...

9 years ago | 0

Answered

Radio Buttons in panel

Panels are basically just cosmetic. Use a |uibuttongroup| to manage the exclusivity behavior you want. Compare: figure ...

Radio Buttons in panel

Panels are basically just cosmetic. Use a |uibuttongroup| to manage the exclusivity behavior you want. Compare: figure ...

9 years ago | 0

| accepted

Answered

Using the optimization toolbox

Yes, Optim TB allows you to just specify the objective function (as a minimization problem -- change the sign if you want maximi...

Using the optimization toolbox

Yes, Optim TB allows you to just specify the objective function (as a minimization problem -- change the sign if you want maximi...

9 years ago | 0

| accepted

Answered

Eliminated zero value in the matrix.

Personally, I'd question whether this is a great idea. A distance matrix is supposed to be square and symmetric, with |dist(j,k...

Eliminated zero value in the matrix.

Personally, I'd question whether this is a great idea. A distance matrix is supposed to be square and symmetric, with |dist(j,k...

10 years ago | 1

| accepted

Answered

How to ensure that dynamically create symbolically variables are real?

This, maybe? names = strcat(List,index,{' '}) eval(['syms ',names{:},'real']) eval(['A = [',names{:},']']) Ergh. ...

How to ensure that dynamically create symbolically variables are real?

This, maybe? names = strcat(List,index,{' '}) eval(['syms ',names{:},'real']) eval(['A = [',names{:},']']) Ergh. ...

10 years ago | 0

Answered

create vectors associated with each entry of an array and save them in a new matrix

The easy, brute-force way is just to append the new return from |linspace| to |W| each time. Start with |W| as an empty array: ...

create vectors associated with each entry of an array and save them in a new matrix

The easy, brute-force way is just to append the new return from |linspace| to |W| each time. Start with |W| as an empty array: ...

10 years ago | 1

Answered

Problem reading an excel csp file using Matlab

The error message is indicating a problem with opening the file. The file identifier returned by |fopen| does not refer to a va...

Problem reading an excel csp file using Matlab

The error message is indicating a problem with opening the file. The file identifier returned by |fopen| does not refer to a va...

10 years ago | 0

Answered

Solving Inequalitis in Matlab

I'm not sure what you mean that the solution to x^2 > 5 "is not correct". When I do syms x solve(x^2 > 5,x) I get th...

Solving Inequalitis in Matlab

I'm not sure what you mean that the solution to x^2 > 5 "is not correct". When I do syms x solve(x^2 > 5,x) I get th...

10 years ago | 1

| accepted

Answered

how can i solve y'=t/t^2+1 by programming a runge kutta 4'th order method ?

# As written, this can't be done, because there's a singularity at t = 0 # Assuming that you actually mean y' = t/(t^2 + 1)... ...

how can i solve y'=t/t^2+1 by programming a runge kutta 4'th order method ?

# As written, this can't be done, because there's a singularity at t = 0 # Assuming that you actually mean y' = t/(t^2 + 1)... ...

10 years ago | 0

| accepted

Answered

How can I create shortcuts by commands?

If you're running 12b or later, why not just <http://www.mathworks.com/help/matlab/creating_guis/app-creation.html package and d...

How can I create shortcuts by commands?

If you're running 12b or later, why not just <http://www.mathworks.com/help/matlab/creating_guis/app-creation.html package and d...

10 years ago | 0

Answered

save data from a for loop - problems with size

This code doesn't run on its own, but by eye it looks like |x2|, |X2|, |y2|, etc are all 3-by-1 column vectors, so |R2| and |R3|...

save data from a for loop - problems with size

This code doesn't run on its own, but by eye it looks like |x2|, |X2|, |y2|, etc are all 3-by-1 column vectors, so |R2| and |R3|...

10 years ago | 0

| accepted

Answered

URGENT!!! Matlab Symbolic Variable Error???

The reason you're getting the error is because one branch of the |if| construct defines an element of |Diagonal| directly from |...

URGENT!!! Matlab Symbolic Variable Error???

The reason you're getting the error is because one branch of the |if| construct defines an element of |Diagonal| directly from |...

10 years ago | 1

Answered

i want to divide 256*256 image into 8*8 blocks and store the 8*8 blocks in the matrix or 2d array something.

Your question isn't quite clear because an image is already a matrix/2D array. (Actually, a true-color image is a 3D array.) S...

i want to divide 256*256 image into 8*8 blocks and store the 8*8 blocks in the matrix or 2d array something.

Your question isn't quite clear because an image is already a matrix/2D array. (Actually, a true-color image is a 3D array.) S...

10 years ago | 1

Answered

Help modifying matlab script for text file

How about this: filename = 'C:\Users\jmille76\Documents\MNVR\20140206\wnw\R2_10k_b1M_l1400.txt'; fileID = fopen(filename...

Help modifying matlab script for text file

How about this: filename = 'C:\Users\jmille76\Documents\MNVR\20140206\wnw\R2_10k_b1M_l1400.txt'; fileID = fopen(filename...

10 years ago | 0

| accepted

Answered

plotting a graph of time vs gear...updated

If I interpret this correctly, you're trying to see which gear you're in at time |t|? So you need to calculate |v| from |t|, th...

plotting a graph of time vs gear...updated

If I interpret this correctly, you're trying to see which gear you're in at time |t|? So you need to calculate |v| from |t|, th...

10 years ago | 1

| accepted

Answered

Generate and Increment var names containing numbers and strings

See dpb's comment on why creating variable names like this is a bad idea, but... assuming you have a valid reason for creating s...

Generate and Increment var names containing numbers and strings

See dpb's comment on why creating variable names like this is a bad idea, but... assuming you have a valid reason for creating s...

10 years ago | 0

| accepted

Answered

Not enough input arguments

The error message you're getting seems to indicate a problem with how you're calling the function, rather than the function itse...

Not enough input arguments

The error message you're getting seems to indicate a problem with how you're calling the function, rather than the function itse...

10 years ago | 0

Answered

Difficulty Assigning String Values after Regexp

Maybe this is oversimplifying, but I think this does what you're trying to do: GoodObject = {'brother', 'sister', 'mother',...

Difficulty Assigning String Values after Regexp

Maybe this is oversimplifying, but I think this does what you're trying to do: GoodObject = {'brother', 'sister', 'mother',...

10 years ago | 0

| accepted

Answered

deleting part of a list of strings

Assuming you have an n-by-1 cell array of strings to start with (and you'd like an n-by-1 cell arrays of strings at the end), he...

deleting part of a list of strings

Assuming you have an n-by-1 cell array of strings to start with (and you'd like an n-by-1 cell arrays of strings at the end), he...

10 years ago | 0

Answered

using vectors as inputs for a function

_"this is not working"_ What is the error message you're getting? Is there any reason to have |HestonCallPriceF| be a functi...

using vectors as inputs for a function

_"this is not working"_ What is the error message you're getting? Is there any reason to have |HestonCallPriceF| be a functi...

10 years ago | 0

| accepted

Answered

Selectively set parameters to fit to 0 in lsqnonlin

Have you tried using the bounds to fix the parameters to be zero? You could set the lower bound to 0 and the upper bound to |re...

Selectively set parameters to fit to 0 in lsqnonlin

Have you tried using the bounds to fix the parameters to be zero? You could set the lower bound to 0 and the upper bound to |re...

10 years ago | 0

| accepted

Answered

Conditional cumsum - how to create?

There may be better ways, but this works: d = [true;diff(input)<0]; idx = find(d); output = input(idx(cumsum(d))); ...

Conditional cumsum - how to create?

There may be better ways, but this works: d = [true;diff(input)<0]; idx = find(d); output = input(idx(cumsum(d))); ...

10 years ago | 2