Answered

MATLAB Answers Wish-list #4 (and bug reports)

For people who don't check the _"Allow users to contact me securely"_ option in their profile, there could/ *should* be a button...

MATLAB Answers Wish-list #4 (and bug reports)

For people who don't check the _"Allow users to contact me securely"_ option in their profile, there could/ *should* be a button...

bijna 5 jaar ago | 2

Answered

how to obtain minimal surface of given coordinates?

Minimal in what sense? fill3( [0,50,50,0], [0,0,50,50], [50,10,50,10], 'y' ) ; grid on ;

how to obtain minimal surface of given coordinates?

Minimal in what sense? fill3( [0,50,50,0], [0,0,50,50], [50,10,50,10], 'y' ) ; grid on ;

bijna 5 jaar ago | 0

Answered

How can I sort my data by within a sorting

[xyz_sorted, id] = sortrows( [x(:),y(:),z(:)] ) ;

How can I sort my data by within a sorting

[xyz_sorted, id] = sortrows( [x(:),y(:),z(:)] ) ;

bijna 5 jaar ago | 0

Answered

How can I read a GeoJSON format file?

See this example: <https://www.mathworks.com/matlabcentral/fileexchange/49813-matlab%C2%AE-for-analyzing-and-visualizing-geos...

How can I read a GeoJSON format file?

See this example: <https://www.mathworks.com/matlabcentral/fileexchange/49813-matlab%C2%AE-for-analyzing-and-visualizing-geos...

bijna 5 jaar ago | 3

Answered

i'm getting vertcat and horizon error in a=[z A z] ..i dont know why?? pls tell me how to resolve

I'm not sure what you want to achieve with this, but I'd say that z=zeros(size(A,1),1); would at least make dimensions m...

i'm getting vertcat and horizon error in a=[z A z] ..i dont know why?? pls tell me how to resolve

I'm not sure what you want to achieve with this, but I'd say that z=zeros(size(A,1),1); would at least make dimensions m...

bijna 5 jaar ago | 0

Answered

Extract rectangular data from a non-rectangular file with header and convert to a structure of column vectors where field names are the second row of the rectangular data

The problem is that your file has discrepancies. If you look at the first row of data, it is missing an |e| before the |+04| in ...

Extract rectangular data from a non-rectangular file with header and convert to a structure of column vectors where field names are the second row of the rectangular data

The problem is that your file has discrepancies. If you look at the first row of data, it is missing an |e| before the |+04| in ...

bijna 5 jaar ago | 1

| accepted

Answered

How do I sort filenames containing text and numbers in numerical order in MATLAB?

If, for any reason, you cannot install this function, you can sort your filenames as follows: [~, reindex] = sort( str2doubl...

How do I sort filenames containing text and numbers in numerical order in MATLAB?

If, for any reason, you cannot install this function, you can sort your filenames as follows: [~, reindex] = sort( str2doubl...

bijna 5 jaar ago | 8

| accepted

Answered

putting several matrices as one

A = randi( 10, 3, 2 ) B = randi( 10, 3, 5 ) C = [A, B]

putting several matrices as one

A = randi( 10, 3, 2 ) B = randi( 10, 3, 5 ) C = [A, B]

bijna 5 jaar ago | 2

Answered

what would be the command to save or open a particular excel data.xls with the designation in a particular drive or folder?

Here is an example. Make sure that the destination folder exists already. If not or if you have to create destination folders dy...

what would be the command to save or open a particular excel data.xls with the designation in a particular drive or folder?

Here is an example. Make sure that the destination folder exists already. If not or if you have to create destination folders dy...

bijna 5 jaar ago | 1

| accepted

Answered

finding consecutive NaN in matrix

>> x = [1,2,3,4,NaN,NaN,NaN,7,8,9] ; >> strfind( isnan(x), true(1,3) ) ans = 5 if you just need a "flag found", do...

finding consecutive NaN in matrix

>> x = [1,2,3,4,NaN,NaN,NaN,7,8,9] ; >> strfind( isnan(x), true(1,3) ) ans = 5 if you just need a "flag found", do...

bijna 5 jaar ago | 0

| accepted

Answered

How do i remove the letter a user inputs from a word?

Simply: function [newStr, num] = removeLetter( str, letter ) newStr = regexprep( str, letter, '', 'ignorecase' ) ; ...

How do i remove the letter a user inputs from a word?

Simply: function [newStr, num] = removeLetter( str, letter ) newStr = regexprep( str, letter, '', 'ignorecase' ) ; ...

bijna 5 jaar ago | 1

Answered

can i used cellfun with a function which has more than one input?

Yes, use an anonymous function (or define a function inline |=>| name your anonymous function) to wrap the call to |chart_fun...

can i used cellfun with a function which has more than one input?

Yes, use an anonymous function (or define a function inline |=>| name your anonymous function) to wrap the call to |chart_fun...

bijna 5 jaar ago | 8

| accepted

Answered

ARRANGING TEXT FILE?

Here is an example, and then we can tailor the solution to your needs from there: content = fileread( 'TEST.txt' ) ; con...

ARRANGING TEXT FILE?

Here is an example, and then we can tailor the solution to your needs from there: content = fileread( 'TEST.txt' ) ; con...

bijna 5 jaar ago | 0

| accepted

Answered

is subset S a subspace of R3?

Now that you have probably finished your exercise, here is |S| with the origin displayed as a red dot: <</matlabcentral/answe...

is subset S a subspace of R3?

Now that you have probably finished your exercise, here is |S| with the origin displayed as a red dot: <</matlabcentral/answe...

bijna 5 jaar ago | 1

Answered

shift array to flat

plot( unnamed, 'b' ) ; hold on ; grid on ; x = (1 : length(unnamed)).' - 1 ; slope = (unnamed(end) - unnamed(1)) / (le...

shift array to flat

plot( unnamed, 'b' ) ; hold on ; grid on ; x = (1 : length(unnamed)).' - 1 ; slope = (unnamed(end) - unnamed(1)) / (le...

bijna 5 jaar ago | 0

| accepted

Answered

how should I copy the selected files to another folder whose name contains 'mytext'

Use copyfile( fname, dest ) ; % or movefile( fname, dest ) ; where |dest| can be defined as dest = fullfile( 'Dest...

how should I copy the selected files to another folder whose name contains 'mytext'

Use copyfile( fname, dest ) ; % or movefile( fname, dest ) ; where |dest| can be defined as dest = fullfile( 'Dest...

bijna 5 jaar ago | 1

| accepted

Answered

How can i find this minima?

While it is not a very robust method, these points are the last points of the curve before the derivative becomes very negative....

How can i find this minima?

While it is not a very robust method, these points are the last points of the curve before the derivative becomes very negative....

bijna 5 jaar ago | 1

Answered

How to write a semifactorial function that iterates up to the input?

This is a good start as you are trying, as a first step, to operate a bit how you would proceed by hand, element by element in a...

How to write a semifactorial function that iterates up to the input?

This is a good start as you are trying, as a first step, to operate a bit how you would proceed by hand, element by element in a...

bijna 5 jaar ago | 1

Answered

Error when using isempty in a while loop

This thread should answer you question about what your variable |a| is and how that works: <https://www.mathworks.com/matlab...

Error when using isempty in a while loop

This thread should answer you question about what your variable |a| is and how that works: <https://www.mathworks.com/matlab...

bijna 5 jaar ago | 0

Answered

Finding Max difference between column vectors

If it is in absolute value: [M, I] = max( abs( A(:,5) - A(:,6) )) and otherwise remove the call to ABS. PS: if you wa...

Finding Max difference between column vectors

If it is in absolute value: [M, I] = max( abs( A(:,5) - A(:,6) )) and otherwise remove the call to ABS. PS: if you wa...

bijna 5 jaar ago | 3

| accepted

Answered

reject input if it is a string

Here is what I think you don't understand: INPUT evaluates what the user types unless called with a second |'s'| argument (in wh...

reject input if it is a string

Here is what I think you don't understand: INPUT evaluates what the user types unless called with a second |'s'| argument (in wh...

bijna 5 jaar ago | 1

Answered

How can I include leading zeros in a number?

Store/read the user input as a string. Or, if you want to bring some flexibility, allow users to enter integers without lead...

How can I include leading zeros in a number?

Store/read the user input as a string. Or, if you want to bring some flexibility, allow users to enter integers without lead...

bijna 5 jaar ago | 13

Answered

Global variables - is there something better?

Look at my answer there if you want to try using a handle class: <https://www.mathworks.com/matlabcentral/answers/359410-is-it-p...

Global variables - is there something better?

Look at my answer there if you want to try using a handle class: <https://www.mathworks.com/matlabcentral/answers/359410-is-it-p...

bijna 5 jaar ago | 0

| accepted

Answered

How to simplify this code without having multilevel indexing error???

Here is one way. I build a simple test data set with 4 structs, each |ji| field contains 3 cells, and each cell contains a 2x2 n...

How to simplify this code without having multilevel indexing error???

Here is one way. I build a simple test data set with 4 structs, each |ji| field contains 3 cells, and each cell contains a 2x2 n...

bijna 5 jaar ago | 1

| accepted

Answered

Storing neighboring coordinates within a sphere from a 3D domain.

Use PDIST2 and get points within a distance smaller (or equal) to the center (node) than the radius. *EDIT :* here is a quick...

Storing neighboring coordinates within a sphere from a 3D domain.

Use PDIST2 and get points within a distance smaller (or equal) to the center (node) than the radius. *EDIT :* here is a quick...

bijna 5 jaar ago | 1

| accepted

Answered

Is it possible to avoid copy-on-write behavior in functions yet?

I agree with most of what is said in the comments/answers. Yet, if you really needed to avoid copies _for good reasons_ in a con...

Is it possible to avoid copy-on-write behavior in functions yet?

I agree with most of what is said in the comments/answers. Yet, if you really needed to avoid copies _for good reasons_ in a con...

bijna 5 jaar ago | 5

Answered

How to load large number of files and perform looping through each file?

You can use the output of DIR to produce a struct array of file names/folders and iterate through files: D = dir( '*.txt' ) ...

How to load large number of files and perform looping through each file?

You can use the output of DIR to produce a struct array of file names/folders and iterate through files: D = dir( '*.txt' ) ...

bijna 5 jaar ago | 0

Answered

How can I select multiple columns in a table using variable names and wildcards?

I am not using tables, so you should probably wait for a better answer, but here is one way that I could see. Say we have the ta...

How can I select multiple columns in a table using variable names and wildcards?

I am not using tables, so you should probably wait for a better answer, but here is one way that I could see. Say we have the ta...

bijna 5 jaar ago | 1

| accepted

Answered

How to read text files form sub-sub folders

Look at the *EDIT 4:09pm* block in the thread: <https://www.mathworks.com/matlabcentral/answers/355855-how-to-read-text-files...

How to read text files form sub-sub folders

Look at the *EDIT 4:09pm* block in the thread: <https://www.mathworks.com/matlabcentral/answers/355855-how-to-read-text-files...

bijna 5 jaar ago | 1

Answered

How to find the number of different strings in a cell array?

Use uc = unique(c) ; to get a cell array of unique strings, and its length is their count. If you need a stat of repet...

How to find the number of different strings in a cell array?

Use uc = unique(c) ; to get a cell array of unique strings, and its length is their count. If you need a stat of repet...

bijna 5 jaar ago | 0

| accepted