Question

Slow readtable and low disk activity

Hi, I am doing a readtable() on a big file. However, I don't see much of a disk activity. The files loads but at a much slowe...

4 months ago | 1 answer | 0

Submitted

Clip Raster By Polygon

Clips a raster by a polygon and extracts certain statistics

1 year ago | 5 downloads |

Answered

gradient descent with noisy data

Try one of the optimization methods in the global optimization toolbox, such as <https://www.mathworks.com/help/gads/particle-sw...

gradient descent with noisy data

Try one of the optimization methods in the global optimization toolbox, such as <https://www.mathworks.com/help/gads/particle-sw...

2 years ago | 0

Answered

How to create finer mesh with material distributions?

You can use <https://www.mathworks.com/help/images/ref/imresize.html imresize()>. Something like this should work. % Initia...

How to create finer mesh with material distributions?

You can use <https://www.mathworks.com/help/images/ref/imresize.html imresize()>. Something like this should work. % Initia...

2 years ago | 0

| accepted

Answered

Perform mathematical operation on matching values

One way is this: mask = (A(:,2)==21); % performing the operation and storing it back in A: % mask is used twice, ...

Perform mathematical operation on matching values

One way is this: mask = (A(:,2)==21); % performing the operation and storing it back in A: % mask is used twice, ...

2 years ago | 0

| accepted

Answered

How to change integer format

fprintf('%0.2d\n',2) 02 fprintf('%0.2d\n',3) 03 fprintf('%0.4d\n',3) 0003

How to change integer format

fprintf('%0.2d\n',2) 02 fprintf('%0.2d\n',3) 03 fprintf('%0.4d\n',3) 0003

2 years ago | 0

| accepted

Question

Where should I report a bug that I find in MATLAB?

Hi, If I think I have found a bug in MATLAB where should I report it? Here is one in Mapping Toolbox: Let's Say I have ...

2 years ago | 3 answers | 0

Question

Issue with launching Parallel Workers when using TORQUE or PBS

Hi, I am attaching the full output of MATLAB when trying to set useParallel option of GA to true. This been causing some t...

2 years ago | 1 answer | 0

Answered

what is the average i have data like

% I assume you have your data in a row x = [1 1.2 1 1.3 1 1.5 3 1.4 3 1.6 3 1.8 3 1.9 4 1.2 4 1.7 4 0.9]; % change i...

what is the average i have data like

% I assume you have your data in a row x = [1 1.2 1 1.3 1 1.5 3 1.4 3 1.6 3 1.8 3 1.9 4 1.2 4 1.7 4 0.9]; % change i...

2 years ago | 1

| accepted

Solved

Sorted highest to lowest?

Return 1 if the input is sorted from highest to lowest, 0 if not. Example: 1:7 -> 0 [7 5 2] -> 1

2 years ago

Answered

Reading data from a multiple csv's in a folder and read until end of a specific column and not starting from top of the file

could you upload a sample CSV file! note that *pos* and *time* are both overwritten in each loop. So what's their purpose? ...

Reading data from a multiple csv's in a folder and read until end of a specific column and not starting from top of the file

could you upload a sample CSV file! note that *pos* and *time* are both overwritten in each loop. So what's their purpose? ...

2 years ago | 0

| accepted

Answered

How do I multiply matrices using multiple GPU?

Well, for the start, XGs_C and XG_C are both Cell arrays. <http://www.mathworks.com/help/distcomp/gputimeit.html gputimeit()> ac...

How do I multiply matrices using multiple GPU?

Well, for the start, XGs_C and XG_C are both Cell arrays. <http://www.mathworks.com/help/distcomp/gputimeit.html gputimeit()> ac...

2 years ago | 1

| accepted

Question

Finally Clause in Try-Catch

Just making sure MATLAB Try/Catch does not have the "finally" block? Correct? I am simulating the behavior using somethin...

2 years ago | 2 answers | 0

Answered

All possible Combinations and equation analysis

a=[1,2]; b=[2,3]; c=[1,4]; % Getting all the combinations [x1,x2,x3]=ndgrid(a,b,c); % reshaping them as...

All possible Combinations and equation analysis

a=[1,2]; b=[2,3]; c=[1,4]; % Getting all the combinations [x1,x2,x3]=ndgrid(a,b,c); % reshaping them as...

3 years ago | 1

| accepted

Answered

Find the actual distances in an image.

Similar approach to this should work: I=imread('P3290337.JPG'); I=padarray(I,[1 1 0],0); thresh = 15; mask = ~(I(:...

Find the actual distances in an image.

Similar approach to this should work: I=imread('P3290337.JPG'); I=padarray(I,[1 1 0],0); thresh = 15; mask = ~(I(:...

3 years ago | 0

| accepted

Question

Possible bug in struct2table()

When I try to convert a single structure to array using <http://www.mathworks.com/help/matlab/ref/struct2table.html struct2table...

3 years ago | 2 answers | 0

Answered

How can I transform 3-dimensional netCDF data to a 2-dimensional table efficiently

I think you are better off keeping it 3D as it is. Here is how you can calculate some of the stuff you asked very easilly. As...

How can I transform 3-dimensional netCDF data to a 2-dimensional table efficiently

I think you are better off keeping it 3D as it is. Here is how you can calculate some of the stuff you asked very easilly. As...

3 years ago | 1

| accepted

Answered

what is different between fget1 and fread ?

I don't think enviread is a function provided by mathworks. It appears it is something that users have provided. Try <http://...

what is different between fget1 and fread ?

I don't think enviread is a function provided by mathworks. It appears it is something that users have provided. Try <http://...

3 years ago | 0

| accepted

Answered

Creating variable averaged over two strata

first convert your date so that you get year and month separately. If you have the date as a string you can use <http://www.math...

Creating variable averaged over two strata

first convert your date so that you get year and month separately. If you have the date as a string you can use <http://www.math...

3 years ago | 0

| accepted

Answered

how can I delete the related raw in B?

A=[3,0.003;1,0.025;2,0.03] A = 3 0.003 1 0.025 2 0.03 B=[1,75;2,102;3,63] B = 1 ...

how can I delete the related raw in B?

A=[3,0.003;1,0.025;2,0.03] A = 3 0.003 1 0.025 2 0.03 B=[1,75;2,102;3,63] B = 1 ...

3 years ago | 0

| accepted

Answered

If A is 4 banded 14 X 14 matrix and B= 14 X 1 matrix. Then how can i solve the system of equation for X where AX=B. A= 1 -2 1 8 -8 3 1 8 -8 3 1 8 -8 3 . .. ... ....... 1 8 -8 3 1 7 1

This is all needed X=A\B

If A is 4 banded 14 X 14 matrix and B= 14 X 1 matrix. Then how can i solve the system of equation for X where AX=B. A= 1 -2 1 8 -8 3 1 8 -8 3 1 8 -8 3 . .. ... ....... 1 8 -8 3 1 7 1

This is all needed X=A\B

3 years ago | 0

| accepted

Question

Unknown number of output variables

There are some functions that support variable number of output variables. For example, <http://www.mathworks.com/help/matlab/re...

3 years ago | 1 answer | 0

Answered

For loop to matrix

Don't need a for loop. Do it like this: V1=49:2:99; V2=zeros(1,numel(V1)); V3=50*ones(1,numel(V1)); b=[V1;V2;V...

For loop to matrix

Don't need a for loop. Do it like this: V1=49:2:99; V2=zeros(1,numel(V1)); V3=50*ones(1,numel(V1)); b=[V1;V2;V...

3 years ago | 2

| accepted

Answered

different set of subplot with loop

for i=1:3 figure for j=1:6 %calculation subplot(2,3,j); %plot commands end end

different set of subplot with loop

for i=1:3 figure for j=1:6 %calculation subplot(2,3,j); %plot commands end end

3 years ago | 0

| accepted

Answered

Read specific 2D matrix from 3D matrix variable from netCDF....

To read a matrix of mXn with third dimension being at r \in [1,p] do this: data = netcdf.getVar(ncid,varid,[1,1,r],[m n 1])...

Read specific 2D matrix from 3D matrix variable from netCDF....

To read a matrix of mXn with third dimension being at r \in [1,p] do this: data = netcdf.getVar(ncid,varid,[1,1,r],[m n 1])...

3 years ago | 1

| accepted

Answered

Running two functions in parallel of which one would like to use parfor

Use non-blocking <http://www.mathworks.com/help/distcomp/parfeval.html parfeval()>.

Running two functions in parallel of which one would like to use parfor

Use non-blocking <http://www.mathworks.com/help/distcomp/parfeval.html parfeval()>.

3 years ago | 3

| accepted

Answered

Is there an alternative to parfor?

Couple of notes here: *NOTE 1* instead of only parallelizing the inner for-loop you can parallelize all of them as follow: ...

Is there an alternative to parfor?

Couple of notes here: *NOTE 1* instead of only parallelizing the inner for-loop you can parallelize all of them as follow: ...

3 years ago | 0

| accepted

Answered

Adding a second for loop to create different matrices

Yes, there is a way; but (really really) not recommended: (why not, refer to Stephens answer) But if you insist, here is how you...

Adding a second for loop to create different matrices

Yes, there is a way; but (really really) not recommended: (why not, refer to Stephens answer) But if you insist, here is how you...

3 years ago | 0

| accepted

Answered

how to obtain a vector contains a mean of other vector

v=[26 196 27 196 28 196]; v1=[mean(v(1:2:end)) mean(v(2:2:end))] v1 = 27 196 You really need to have...

how to obtain a vector contains a mean of other vector

v=[26 196 27 196 28 196]; v1=[mean(v(1:2:end)) mean(v(2:2:end))] v1 = 27 196 You really need to have...

3 years ago | 0

| accepted