回答済み

Clearing Global variables... except for.

To remove the variables locally clear(globals{:}) to remove them globally clear('global', var{:}) You should also...

Clearing Global variables... except for.

To remove the variables locally clear(globals{:}) to remove them globally clear('global', var{:}) You should also...

9年以上 前 | 2

回答済み

Pass variable by reference to function

While I think IA's answer is the better way to do it. If you really want to do what you are talking about you can create a subcl...

Pass variable by reference to function

While I think IA's answer is the better way to do it. If you really want to do what you are talking about you can create a subcl...

9年以上 前 | 5

| 採用済み

回答済み

looking for an efficient way to activate all fprintf in the function

If you are using a function, you can overload fprintf with a nested function. function myfunction(debug) fprintf('first...

looking for an efficient way to activate all fprintf in the function

If you are using a function, you can overload fprintf with a nested function. function myfunction(debug) fprintf('first...

9年以上 前 | 3

| 採用済み

回答済み

sum every 24 rows in a vector

I am not sure what all the code you posted has to do with anything ... If I have a 8760x1 array x = randn(8760, 1); I...

sum every 24 rows in a vector

I am not sure what all the code you posted has to do with anything ... If I have a 8760x1 array x = randn(8760, 1); I...

9年以上 前 | 2

回答済み

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

9年以上 前 | 13

回答済み

delete element from vector

I can think of three ways that are all slightly different a=[1,2,3,4,5]; If you want to get rid of all cases where |a| i...

delete element from vector

I can think of three ways that are all slightly different a=[1,2,3,4,5]; If you want to get rid of all cases where |a| i...

9年以上 前 | 79

| 採用済み

回答済み

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

9年以上 前 | 2

回答済み

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

9年以上 前 | 0

回答済み

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, ''')']); ...

9年以上 前 | 1

| 採用済み

回答済み

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

9年以上 前 | 2

| 採用済み

回答済み

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

9年以上 前 | 2

回答済み

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

10年弱 前 | 5

回答済み

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

10年弱 前 | 9

| 採用済み

回答済み

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

10年弱 前 | 1

回答済み

What frustrates you about MATLAB?

The number of MATLAB users using old versions who cannot cope with code written for new versions frustrates me. It would be easi...

What frustrates you about MATLAB?

The number of MATLAB users using old versions who cannot cope with code written for new versions frustrates me. It would be easi...

10年弱 前 | 0

回答済み

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

10年弱 前 | 5

| 採用済み

回答済み

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

10年弱 前 | 3

質問

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

10年弱 前 | 7 件の回答 | 8

質問

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

10年弱 前 | 2 件の回答 | 2

回答済み

subclassing MException

There are a lot of places you can go wrong, and without the code, it is hard to guess... classdef testclass < MException ...

subclassing MException

There are a lot of places you can go wrong, and without the code, it is hard to guess... classdef testclass < MException ...

10年弱 前 | 4

質問

MATLAB Stack Exchange

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

10年弱 前 | 2 件の回答 | 3

回答済み

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

約10年 前 | 1

| 採用済み

回答済み

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

約10年 前 | 1

| 採用済み

回答済み

What is the reasoning behind the fact that min(0,NaN) is 0?

Given the behavior of MIN, I find it odd that there is a NANMIN function.

What is the reasoning behind the fact that min(0,NaN) is 0?

Given the behavior of MIN, I find it odd that there is a NANMIN function.

約10年 前 | 2

回答済み

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

約10年 前 | 1

回答済み

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

約10年 前 | 3

回答済み

Wish-list for MATLAB Answer sections.

That before/when the magic editor powers kick in (edit and delete buttons showing up everywhere) that an email is sent to the ed...

Wish-list for MATLAB Answer sections.

That before/when the magic editor powers kick in (edit and delete buttons showing up everywhere) that an email is sent to the ed...

約10年 前 | 0

回答済み

Pause function in matlab for 1 millisecond

Getting millisecond timing accuracy is extremely difficult in most programming languages since the underlying clocks are just no...

Pause function in matlab for 1 millisecond

Getting millisecond timing accuracy is extremely difficult in most programming languages since the underlying clocks are just no...

約10年 前 | 4

回答済み

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

約10年 前 | 1

| 採用済み

回答済み

Play a wav sound in a loop without blocking it

You can use audioplayer instead of wavplay doc audioplayer Retriggering your sound card 100 times a second is going to b...

Play a wav sound in a loop without blocking it

You can use audioplayer instead of wavplay doc audioplayer Retriggering your sound card 100 times a second is going to b...

約10年 前 | 1

| 採用済み