Answered

insert element in vector

While I think this is a homework problem ... Function handles and cat are your friends insert = @(a, x, n)cat(2, x(1:n)...

insert element in vector

While I think this is a homework problem ... Function handles and cat are your friends insert = @(a, x, n)cat(2, x(1:n)...

oltre 7 anni ago | 9

Answered

What is the variable 'self' in MATLAB class?

There is nothing special about the variable "self". In MATLAB many people use "obj" instead. There is something special about th...

What is the variable 'self' in MATLAB class?

There is nothing special about the variable "self". In MATLAB many people use "obj" instead. There is something special about th...

oltre 7 anni ago | 1

Answered

MATLAB's JIT Engine

I am not sure it is possible to separate the MATLAB JIT accelerator from the rest of MATLAB. MATLAB is fast enough for most of w...

MATLAB's JIT Engine

I am not sure it is possible to separate the MATLAB JIT accelerator from the rest of MATLAB. MATLAB is fast enough for most of w...

oltre 7 anni ago | 0

Answered

retrieve mat-file version

You can use evalc to capture the output of type function tf = getmatv(fname) x = evalc(['type(''', fname, ''')']); ...

retrieve mat-file version

You can use evalc to capture the output of type function tf = getmatv(fname) x = evalc(['type(''', fname, ''')']); ...

oltre 7 anni ago | 1

| accepted

Answered

Is there something like a 'struct pointer' in Matlab?

I disagree with Walter and think MATLAB does provide this functionality in the OO HANDLE superclass. You can create a handle str...

Is there something like a 'struct pointer' in Matlab?

I disagree with Walter and think MATLAB does provide this functionality in the OO HANDLE superclass. You can create a handle str...

oltre 7 anni ago | 2

| accepted

Answered

regexprep with multiple expression

Is this what you want? ttxt = 'hello parish world borough foo census area bar'; regexprep(ttxt, ' parish| borough| censu...

regexprep with multiple expression

Is this what you want? ttxt = 'hello parish world borough foo census area bar'; regexprep(ttxt, ' parish| borough| censu...

oltre 7 anni ago | 1

Answered

Code in script is printing to command window

I can think of three ways of doing this. * Set break points to narrow down where the output occurs. This could involve a lot...

Code in script is printing to command window

I can think of three ways of doing this. * Set break points to narrow down where the output occurs. This could involve a lot...

oltre 7 anni ago | 5

Answered

How do I count the number of NaNs in a Vector?

This is a straight forward question and given you haven't shown any attempt to solve it, I am hesitant to provide an answer ... ...

How do I count the number of NaNs in a Vector?

This is a straight forward question and given you haven't shown any attempt to solve it, I am hesitant to provide an answer ... ...

oltre 7 anni ago | 6

| accepted

Answered

Question about 'lognrnd' function

Why not just test it: R = lognrnd(0, 8, 1e6, 1); std(R) ans = 1.8915e+13 std(log(R)) ans = 7.9976

Question about 'lognrnd' function

Why not just test it: R = lognrnd(0, 8, 1e6, 1); std(R) ans = 1.8915e+13 std(log(R)) ans = 7.9976

oltre 7 anni ago | 1

Answered

How is the MarkerSize of a 'Circle' marker defined

The circle marker size appears to be the number of points in the diameter. For the other markers, it is not so clear. You can cr...

How is the MarkerSize of a 'Circle' marker defined

The circle marker size appears to be the number of points in the diameter. For the other markers, it is not so clear. You can cr...

oltre 7 anni ago | 2

| accepted

Answered

Check if filename is valid.

A long time ago, probably Windows 95 on a FAT16 harddisk, I started using the following: regexp(fname, ['^(?!^(PRN|AUX|CLOC...

Check if filename is valid.

A long time ago, probably Windows 95 on a FAT16 harddisk, I started using the following: regexp(fname, ['^(?!^(PRN|AUX|CLOC...

oltre 7 anni ago | 3

Question

When to accept an answer for someone

TMW has now given many of us the power to accept answers for other people, but haven't provided any guidance as to when we shoul...

oltre 7 anni ago | 7 answers | 8

Question

MESSAGE function and error handling

I just stumbled across the MESSAGE function which takes a message identifier of the form foo:bar:id and creates an objec...

oltre 7 anni ago | 2 answers | 2

Question

MATLAB Stack Exchange

What do people think of the <http://area51.stackexchange.com/proposals/38040/matlab#_=_ MATLAB Stack Exchange> proposal?

oltre 7 anni ago | 1 answer | 3

Answered

command in Matlab equivalent to "forall " in fortran

The JIT accelerator that was introduced 10 years ago has sped up loops substantially, it is an unfortunate myth that MATLAB loop...

command in Matlab equivalent to "forall " in fortran

The JIT accelerator that was introduced 10 years ago has sped up loops substantially, it is an unfortunate myth that MATLAB loop...

oltre 7 anni ago | 1

| accepted

Answered

Scheduling a Matlab Script

You need to enclose the entire command in quotes. You do not need the path on the function/script you want to run and do not wan...

Scheduling a Matlab Script

You need to enclose the entire command in quotes. You do not need the path on the function/script you want to run and do not wan...

oltre 7 anni ago | 1

| accepted

Answered

What is it that I get from MATLAB function probplot?

Basically, if your data came from the chosen distribution (exponential/Weibull) then the blue data points would overlap the dash...

What is it that I get from MATLAB function probplot?

Basically, if your data came from the chosen distribution (exponential/Weibull) then the blue data points would overlap the dash...

oltre 7 anni ago | 1

Answered

Getting first element of a function output

See this <http://www.mathworks.com/matlabcentral/answers/1325-what-is-missing-from-matlab#answer_1931 answer> about what is miss...

Getting first element of a function output

See this <http://www.mathworks.com/matlabcentral/answers/1325-what-is-missing-from-matlab#answer_1931 answer> about what is miss...

oltre 7 anni ago | 2

Answered

Ensure x label never cut off

A "manual" method of fixing cutoff labels by making the axis smaller is relatively easy to implement. You pick a scale value tha...

Ensure x label never cut off

A "manual" method of fixing cutoff labels by making the axis smaller is relatively easy to implement. You pick a scale value tha...

oltre 7 anni ago | 1

| accepted

Question

Query event queue

Is it possible to query the event queue (i.e., where callbacks wait for drawnow)? I have a for loop that takes a ~10 seconds ...

oltre 7 anni ago | 1 answer | 1

Answered

Calculation speed

Why not just use bench? doc bench Your lack of preallocation is probably distorting your results for your university des...

Calculation speed

Why not just use bench? doc bench Your lack of preallocation is probably distorting your results for your university des...

circa 8 anni ago | 3

Answered

continue for-loop despite matlab error

You could do something like for ii = 1:n try % your code catch ME warning('Something happened'); ...

continue for-loop despite matlab error

You could do something like for ii = 1:n try % your code catch ME warning('Something happened'); ...

circa 8 anni ago | 4

| accepted

Answered

What is missing from MATLAB?

I wish there were better functions for comparing performance across platforms and versions. Something like a stable bench on ste...

What is missing from MATLAB?

I wish there were better functions for comparing performance across platforms and versions. Something like a stable bench on ste...

circa 8 anni ago | 2

Answered

Is there a way to 'fold up' sections of code - like when you close up a for loop

Under preferences you can enable code folding for blocks. Blocks are defined in MATLAB as sections starting with %% (I am not su...

Is there a way to 'fold up' sections of code - like when you close up a for loop

Under preferences you can enable code folding for blocks. Blocks are defined in MATLAB as sections starting with %% (I am not su...

circa 8 anni ago | 10

| accepted

Answered

Sequence within a sequence

n = 5; m = 3; reshape(repmat(1:n, m, 1), n*m, 1)

Sequence within a sequence

n = 5; m = 3; reshape(repmat(1:n, m, 1), n*m, 1)

circa 8 anni ago | 1

Answered

can I disable entire sections of code temporarily

You can enclose code in an if block if false ... end or even better (since you can include invalid syntax) woul...

can I disable entire sections of code temporarily

You can enclose code in an if block if false ... end or even better (since you can include invalid syntax) woul...

circa 8 anni ago | 7

Answered

Is "matlab" or "matlab code" a useful tag?

I could see the "matlab" tag being useful when you only want MATLAB solutions and not ones that require you to do something at t...

Is "matlab" or "matlab code" a useful tag?

I could see the "matlab" tag being useful when you only want MATLAB solutions and not ones that require you to do something at t...

circa 8 anni ago | 3

Answered

including subject_name in variable with a loop

You can do it with eval, but then in a few days you will be back asking how to use the variables. This is a FAQ, and is generall...

including subject_name in variable with a loop

You can do it with eval, but then in a few days you will be back asking how to use the variables. This is a FAQ, and is generall...

circa 8 anni ago | 1

Answered

functions vs. script

While I wouldn't term it private/public, the unique workspaces that you hint at in pro 1 is the real selling point to me. With a...

functions vs. script

While I wouldn't term it private/public, the unique workspaces that you hint at in pro 1 is the real selling point to me. With a...

circa 8 anni ago | 5

Answered

call functions from subpath

I am posting this as a new answer because I think it is long enough, but it is based on a comment to my previous answer. If ...

call functions from subpath

I am posting this as a new answer because I think it is long enough, but it is based on a comment to my previous answer. If ...

circa 8 anni ago | 3