답변 있음

Does matlab create pointers to objects or create new copies?

See Comparison of Handle and Value Classes

Does matlab create pointers to objects or create new copies?

See Comparison of Handle and Value Classes

2달 전 | 1

| 수락됨

답변 있음

Namespace management for packages+sub-packages

Yes, that's the way it is. And sprinkle the code with import doesn't really help. Nevertheless, I find packages useful. A bett...

Namespace management for packages+sub-packages

Yes, that's the way it is. And sprinkle the code with import doesn't really help. Nevertheless, I find packages useful. A bett...

2달 전 | 0

답변 있음

Mean command gives wrong answer

Analyze this %% x=[1,2,3,4,5,6,7,8,9,10,11,12]; % x values y=[15,120,2,30,40,150,60,170,80,9,15,1000]; % y values %% idx1 =...

Mean command gives wrong answer

Analyze this %% x=[1,2,3,4,5,6,7,8,9,10,11,12]; % x values y=[15,120,2,30,40,150,60,170,80,9,15,1000]; % y values %% idx1 =...

2달 전 | 1

| 수락됨

답변 있음

Are enum-comparisons slow in MATLAB?

Indeed, enumerations make slow code. This is an anecdote about a code based on enumeration that proved useless because of poor...

Are enum-comparisons slow in MATLAB?

Indeed, enumerations make slow code. This is an anecdote about a code based on enumeration that proved useless because of poor...

2달 전 | 0

| 수락됨

답변 있음

Basic queries Matlab (vectors, indexing, construct matrices in a specific form)

Exercise 1 and 2 "[...] however it confuses me the way the question is written!" Agree; the very same vector has three differe...

Basic queries Matlab (vectors, indexing, construct matrices in a specific form)

Exercise 1 and 2 "[...] however it confuses me the way the question is written!" Agree; the very same vector has three differe...

3달 전 | 0

| 수락됨

답변 있음

keep element greater than immediate previous element

An alternative %% x = [1 2 3 4 3 2 3 4 6 8 5 5 6 8.5 9 11 12 ]; %% dx = 1; while not( isempty( dx ) ) dx = fin...

keep element greater than immediate previous element

An alternative %% x = [1 2 3 4 3 2 3 4 6 8 5 5 6 8.5 9 11 12 ]; %% dx = 1; while not( isempty( dx ) ) dx = fin...

3달 전 | 1

답변 있음

How to reduce computation time

On R2018b and a new vanilla PC I found a significant decrease in computation time by replacing quad2d() by integral2() (with the...

How to reduce computation time

On R2018b and a new vanilla PC I found a significant decrease in computation time by replacing quad2d() by integral2() (with the...

3달 전 | 1

답변 있음

How can I write a variable which datatype is a string in netcdf file

Most likely, the space you specified for the variable calibration_procedure in the nc-file, i.e. 'Dimensions',{'hydrophone_cou...

How can I write a variable which datatype is a string in netcdf file

Most likely, the space you specified for the variable calibration_procedure in the nc-file, i.e. 'Dimensions',{'hydrophone_cou...

3달 전 | 0

| 수락됨

답변 있음

constructing a difficult large matrix

Here are three functions, two of which are based on the answer of David Goodmanson. I think all of them are fast enough. However...

constructing a difficult large matrix

Here are three functions, two of which are based on the answer of David Goodmanson. I think all of them are fast enough. However...

3달 전 | 1

답변 있음

Randomly convert exact number of 1 to 0 in binary matrix

Try %% x = [ 0 1 0 1 0 1 1 1 1]; %% ix_one = find( x == 1 ); ix_set_zero = randi( numel(ix_one), 1,2 ); x( ...

Randomly convert exact number of 1 to 0 in binary matrix

Try %% x = [ 0 1 0 1 0 1 1 1 1]; %% ix_one = find( x == 1 ); ix_set_zero = randi( numel(ix_one), 1,2 ); x( ...

3달 전 | 0

| 수락됨

답변 있음

number permutate without permutation

Steps to find a substitute for perms without perms Lookup perms in the documenttion, perms, All possible permutations See "Se...

number permutate without permutation

Steps to find a substitute for perms without perms Lookup perms in the documenttion, perms, All possible permutations See "Se...

3달 전 | 0

답변 있음

is 2GB RAM ok for MATLAB 2020 ?

Yes, you don't need to install Polyspace, but plain Matlab requires a minimum of 4GB. See System Requirements for MATLAB R2020a

is 2GB RAM ok for MATLAB 2020 ?

Yes, you don't need to install Polyspace, but plain Matlab requires a minimum of 4GB. See System Requirements for MATLAB R2020a

3달 전 | 0

| 수락됨

답변 있음

Storing data from a loop

Pre-allocate Y1 and Y2 Assign to elements of Y1 and Y2 Do not change the loop counter, ii, in the loop The documentation say...

Storing data from a loop

Pre-allocate Y1 and Y2 Assign to elements of Y1 and Y2 Do not change the loop counter, ii, in the loop The documentation say...

3달 전 | 0

답변 있음

I am having problems with my homework:Write a function called valid_date that takes three positive integer scalar inputs year, month, day....

Replace (rem(year,4)==0 && rem(year,100)~=0) || (rem(year,400)==0 && rem(year,100)~=0) by (rem(year,4)==0 && rem(year,100)~=...

I am having problems with my homework:Write a function called valid_date that takes three positive integer scalar inputs year, month, day....

Replace (rem(year,4)==0 && rem(year,100)~=0) || (rem(year,400)==0 && rem(year,100)~=0) by (rem(year,4)==0 && rem(year,100)~=...

3달 전 | 0

답변 있음

cellfun vs. varfun applied to column of table

This works, but may contain more code than you hoped for. %% T = table({'147956, 154414'; '1, 7439'; '93053, 101815'; '50151, ...

cellfun vs. varfun applied to column of table

This works, but may contain more code than you hoped for. %% T = table({'147956, 154414'; '1, 7439'; '93053, 101815'; '50151, ...

3달 전 | 1

답변 있음

Continuing an input function onto another line

The documentation says; The start and end quotation marks for a character vector must appear on the same line. For example, thi...

Continuing an input function onto another line

The documentation says; The start and end quotation marks for a character vector must appear on the same line. For example, thi...

3달 전 | 0

답변 있음

export codes written in editor into word

See Bring along your syntax highlighted code and M2HTML: Documentation System for MATLAB in HTML

export codes written in editor into word

See Bring along your syntax highlighted code and M2HTML: Documentation System for MATLAB in HTML

3달 전 | 1

| 수락됨

답변 있음

Transaction Data in HTML file

This is a start %% sad = dir( 'd:\m\cssm\transData*.txt' ); len = length( sad ); out = cell( len, 2 ); for jj = 1 : len ...

Transaction Data in HTML file

This is a start %% sad = dir( 'd:\m\cssm\transData*.txt' ); len = length( sad ); out = cell( len, 2 ); for jj = 1 : len ...

3달 전 | 0

| 수락됨

답변 있음

Textscan with '@' as delimiter

I've reproduced your result on R2018b. The result is according to the textscan documentation - I think. out1 is a cell array of...

Textscan with '@' as delimiter

I've reproduced your result on R2018b. The result is according to the textscan documentation - I think. out1 is a cell array of...

3달 전 | 0

| 수락됨

답변 있음

Converting txt file into title and array?

Try this %% fid = fopen( 'cssm.txt', 'rt' ); xL = fgetl( fid ); % read the first line data = fscanf( fid, '...

Converting txt file into title and array?

Try this %% fid = fopen( 'cssm.txt', 'rt' ); xL = fgetl( fid ); % read the first line data = fscanf( fid, '...

3달 전 | 0

| 수락됨

답변 있음

Updating a Property in an Array of Objects

The documentation doesn't tell that a statement like [WorkOrder(1,:,1).nid] = listData.nid(:,1); isn't possible. You are not t...

Updating a Property in an Array of Objects

The documentation doesn't tell that a statement like [WorkOrder(1,:,1).nid] = listData.nid(:,1); isn't possible. You are not t...

3달 전 | 0

| 수락됨

답변 있음

apply function to all fields in a structure array

Another mix of structfun and arrayfun >> max( cell2mat( arrayfun( @(S) structfun( @(f) f, S.F1 ), sa, 'uni',false ) ), [], 2 ) ...

apply function to all fields in a structure array

Another mix of structfun and arrayfun >> max( cell2mat( arrayfun( @(S) structfun( @(f) f, S.F1 ), sa, 'uni',false ) ), [], 2 ) ...

3달 전 | 0

| 수락됨

답변 있음

Preallocation of a matrix: how to shrink it afterwards?

Something like this fullstate = class_of_state( size(epochn) ); for t = reshape( epochn, 1,[] ) idx = find(epochn == t); ...

Preallocation of a matrix: how to shrink it afterwards?

Something like this fullstate = class_of_state( size(epochn) ); for t = reshape( epochn, 1,[] ) idx = find(epochn == t); ...

3달 전 | 0

답변 있음

How to read only some columns of a text file?

The text file might have more than 7 coloums. Replace '%*n %*n %n %n %n %n %n' by '%*s%*s%n%n%n%n%n%*[^\n]' %*[^\n]' ski...

How to read only some columns of a text file?

The text file might have more than 7 coloums. Replace '%*n %*n %n %n %n %n %n' by '%*s%*s%n%n%n%n%n%*[^\n]' %*[^\n]' ski...

3달 전 | 0

답변 있음

how to control the length of indexed array element?

"(from 1 to the last bit of m(i)) " Here is my shot in the dark %% m = uint8([1,2,3,4]); len = length(m); m_d = 0.5*...

how to control the length of indexed array element?

"(from 1 to the last bit of m(i)) " Here is my shot in the dark %% m = uint8([1,2,3,4]); len = length(m); m_d = 0.5*...

3달 전 | 0

| 수락됨

답변 있음

anonymous function with a variable number of input variables

"anonymous function with a variable number of input variables" Something like this? >> ht(1,2,3) ans = 6 >> ht(1,2,3,4...

anonymous function with a variable number of input variables

"anonymous function with a variable number of input variables" Something like this? >> ht(1,2,3) ans = 6 >> ht(1,2,3,4...

3달 전 | 1

답변 있음

How to read spreadsheet files iteratively?

Replace readtable('filename.xls'); by readtable( [ filename, '.xls' ] ); to use the value of the variable not its name.

How to read spreadsheet files iteratively?

Replace readtable('filename.xls'); by readtable( [ filename, '.xls' ] ); to use the value of the variable not its name.

3달 전 | 1

| 수락됨

답변 있음

How to use R2020a import tool to upload multiple excel files

YES! See Import or Export a Sequence of Files and How can I process a sequence of files?

How to use R2020a import tool to upload multiple excel files

YES! See Import or Export a Sequence of Files and How can I process a sequence of files?

3달 전 | 1

답변 있음

convert matrix data to cell array data

Try this >> num2cell( magic(5), 1 ) ans = 1×5 cell array Columns 1 through 4 {5×1 double} {5×1 double} {5×1 d...

convert matrix data to cell array data

Try this >> num2cell( magic(5), 1 ) ans = 1×5 cell array Columns 1 through 4 {5×1 double} {5×1 double} {5×1 d...

3달 전 | 0

| 수락됨