Answered

Remove zoom from axes

This should be a good entrypoint: https://www.mathworks.com/help/matlab/ref/disabledefaultinteractivity.html https://www.mathw...

Remove zoom from axes

This should be a good entrypoint: https://www.mathworks.com/help/matlab/ref/disabledefaultinteractivity.html https://www.mathw...

1 year ago | 0

Answered

Can I pass arguments to a @callbackFcn?

configureCallback(s,"terminator",@(src,evnt)readSerialData(src,evnt,operation mode)) So the first parentheses specify the inter...

Can I pass arguments to a @callbackFcn?

configureCallback(s,"terminator",@(src,evnt)readSerialData(src,evnt,operation mode)) So the first parentheses specify the inter...

1 year ago | 2

| accepted

Answered

I am trying to find the exact distance of a curvy line.

Assuming that the boundary points are ordered well (adjacently), then you can calculate the cummulative square distance between ...

I am trying to find the exact distance of a curvy line.

Assuming that the boundary points are ordered well (adjacently), then you can calculate the cummulative square distance between ...

1 year ago | 0

Answered

Take only some values from one array

you can't compare arrays of different lengths. a straightforward but cumbersome way is to cycle through each of your t1 and find...

Take only some values from one array

you can't compare arrays of different lengths. a straightforward but cumbersome way is to cycle through each of your t1 and find...

1 year ago | 0

Answered

MATLAB GUIDE to App migration question

Apparently it should work: https://www.mathworks.com/help/matlab/creating_guis/compatibility-between-different-releases-of-app-...

MATLAB GUIDE to App migration question

Apparently it should work: https://www.mathworks.com/help/matlab/creating_guis/compatibility-between-different-releases-of-app-...

1 year ago | 0

| accepted

Answered

How to Save new data to existing structure data in a for loop without having to save the complete Matlab file from Zero?

I would consider using a database, a lightweight solution could be sqlite. I use the third party mksqlite for this purpose and i...

How to Save new data to existing structure data in a for loop without having to save the complete Matlab file from Zero?

I would consider using a database, a lightweight solution could be sqlite. I use the third party mksqlite for this purpose and i...

1 year ago | 0

Answered

using varfun on a timetable with subscripts?

first of all, your operation looks like a "diff", no subscripts (for rows, i.e., timestamps) necessary second, you will be defi...

using varfun on a timetable with subscripts?

first of all, your operation looks like a "diff", no subscripts (for rows, i.e., timestamps) necessary second, you will be defi...

1 year ago | 0

| accepted

Answered

How can I quickly obtain the inverse of a square sparse matrix?

potentially, if you have more information about the properties of A, you can specify them in a call to linsolve https://www.mat...

How can I quickly obtain the inverse of a square sparse matrix?

potentially, if you have more information about the properties of A, you can specify them in a call to linsolve https://www.mat...

1 year ago | 0

| accepted

Answered

3D/2D matrix multiplication without using a loop

I found this: pagemtimes() s = rand(5,5); x = rand(5,8,100000); tic y = pagemtimes(s,x); toc tic z = nan(size(x)); for...

3D/2D matrix multiplication without using a loop

I found this: pagemtimes() s = rand(5,5); x = rand(5,8,100000); tic y = pagemtimes(s,x); toc tic z = nan(size(x)); for...

1 year ago | 0

Answered

How to operate properly with multidimensional matrices and cells.

You might be looking for squeeze()? l=0; % preallocate C = cell(3,3,3); M = nan(3,3,3); % construct 3D cell and matrix ...

How to operate properly with multidimensional matrices and cells.

You might be looking for squeeze()? l=0; % preallocate C = cell(3,3,3); M = nan(3,3,3); % construct 3D cell and matrix ...

1 year ago | 1

Answered

How to solve a system of second order nonlinear differential equations with boundary conditions

This is a boundary value problem, so probably the most straightforward way is to use bvp4c or bvp5c if you want to solve numeric...

How to solve a system of second order nonlinear differential equations with boundary conditions

This is a boundary value problem, so probably the most straightforward way is to use bvp4c or bvp5c if you want to solve numeric...

1 year ago | 1

| accepted

Answered

Backward and Central Difference

I guess the answer depends what you want to do with those finite difference approximations. If you want to use it in an algorith...

Backward and Central Difference

I guess the answer depends what you want to do with those finite difference approximations. If you want to use it in an algorith...

1 year ago | 0

| accepted

Answered

Save class object as struct

Look at this too: https://www.mathworks.com/help/matlab/matlab_oop/flexible-saveobj-and-loadobj-pattern.html I think it means w...

Save class object as struct

Look at this too: https://www.mathworks.com/help/matlab/matlab_oop/flexible-saveobj-and-loadobj-pattern.html I think it means w...

1 year ago | 1

| accepted

Answered

Can't get string to datetime conversion to work

str = '2019-05-17T19:36:00'; fmt = 'yyyy-MM-dd HH:mm:ss'; b = strrep(str,'T',' '); disp(b); timestamp = datetime(b,'Inpu...

Can't get string to datetime conversion to work

str = '2019-05-17T19:36:00'; fmt = 'yyyy-MM-dd HH:mm:ss'; b = strrep(str,'T',' '); disp(b); timestamp = datetime(b,'Inpu...

1 year ago | 0

Answered

Auto Refresh in app designer.

in general for "auto refresh" you can use the timer object to schedule recurrent execution - disclaimer i have only played with ...

Auto Refresh in app designer.

in general for "auto refresh" you can use the timer object to schedule recurrent execution - disclaimer i have only played with ...

1 year ago | 0

| accepted

Answered

Using Hessian for least squares problem

Now that the actual question is clarified as a coding question and not a math question, it seems these should help: https://www...

Using Hessian for least squares problem

Now that the actual question is clarified as a coding question and not a math question, it seems these should help: https://www...

1 year ago | 0

| accepted

Answered

Select rows in a given table according to 3 criteria

This is small enough you could generate the full list of combinations % generate all combinations alltriplets = nchoosek(1:7,3...

Select rows in a given table according to 3 criteria

This is small enough you could generate the full list of combinations % generate all combinations alltriplets = nchoosek(1:7,3...

1 year ago | 0

| accepted

Answered

Iterating array of chars and saving to table or cell

Try this, if your function actually returns strings as your output suggests (rather than a char array) result = strings(length(...

Iterating array of chars and saving to table or cell

Try this, if your function actually returns strings as your output suggests (rather than a char array) result = strings(length(...

1 year ago | 1

| accepted

Answered

Interpolate X-Y coordinates with variable velocity to specified sampling frequency

I don't think you need loops...so assume your data is called XYV, and according to how you describe, I guess the last velocity p...

Interpolate X-Y coordinates with variable velocity to specified sampling frequency

I don't think you need loops...so assume your data is called XYV, and according to how you describe, I guess the last velocity p...

1 year ago | 0

| accepted

Answered

How to interpolate between two adjacent points of time series data, if the difference between any two consecutive points is greater than 25 by using for loop?

If you just want the points to be "appear" roughly evenly distributed, you could consider spacing in the arc length (although yo...

How to interpolate between two adjacent points of time series data, if the difference between any two consecutive points is greater than 25 by using for loop?

If you just want the points to be "appear" roughly evenly distributed, you could consider spacing in the arc length (although yo...

1 year ago | 2

Answered

How to interpolate between two adjacent points of time series data, if the difference between any two consecutive points is greater than 25 by using for loop?

Here's [another approximate] way to do it that will only call spline once (could as well do it with gridded interpolant) The me...

How to interpolate between two adjacent points of time series data, if the difference between any two consecutive points is greater than 25 by using for loop?

Here's [another approximate] way to do it that will only call spline once (could as well do it with gridded interpolant) The me...

1 year ago | 2

Answered

Randomly selecting images from a directory

Use "dir" and "randperm"

Randomly selecting images from a directory

Use "dir" and "randperm"

1 year ago | 0

| accepted

Answered

Why won't cells populate via if-else statements?

The if statements are probably your problem...you are comparing a column vector with scalars, which off the top of my head I don...

Why won't cells populate via if-else statements?

The if statements are probably your problem...you are comparing a column vector with scalars, which off the top of my head I don...

1 year ago | 0

Answered

Grouping age data into 5 year bins

Interesting, this could be useful for me too! You can use "discretize" to bin the data. Below is a quick and dirty class to impl...

Grouping age data into 5 year bins

Interesting, this could be useful for me too! You can use "discretize" to bin the data. Below is a quick and dirty class to impl...

1 year ago | 0

Answered

How to vectorize the following code for matrix insertion?

There is a minor point in David's answer, which is that not all index collisions are taken care of in how the g matrix is constr...

How to vectorize the following code for matrix insertion?

There is a minor point in David's answer, which is that not all index collisions are taken care of in how the g matrix is constr...

1 year ago | 1

| accepted

Answered

How to rotate 3D matrix?

it looks like your segment A is parallel to the axis OA (trivial in y-direction), in which case it should be easy to first trans...

How to rotate 3D matrix?

it looks like your segment A is parallel to the axis OA (trivial in y-direction), in which case it should be easy to first trans...

1 year ago | 0

| accepted

Answered

1-D Temperature Gradient

your time and space point vectors are t = 0:0.005:50; % but this gives you 10,001 points, not 10,000...so you decide what you h...

1-D Temperature Gradient

your time and space point vectors are t = 0:0.005:50; % but this gives you 10,001 points, not 10,000...so you decide what you h...

1 year ago | 0

Answered

how to find the order of convergence

It sounds like you already implemented Newton's method, so just save all your residuals and plot [the log of norm] versus the pr...

how to find the order of convergence

It sounds like you already implemented Newton's method, so just save all your residuals and plot [the log of norm] versus the pr...

2 years ago | 0

Answered

Saving each vector of an ode45 vector solution in a matrix.

Use a cell array instead z = cell(1,20) for i=1:20 G=i/20 %Saving that iterates value of G [phi,y]=ode45(@(phi,y) od...

Saving each vector of an ode45 vector solution in a matrix.

Use a cell array instead z = cell(1,20) for i=1:20 G=i/20 %Saving that iterates value of G [phi,y]=ode45(@(phi,y) od...

2 years ago | 0

Answered

How can I generate values randomly from another existing vecor?

how about v1 = [122,34,20,5,21] v1a = [0,v1] N = numel(v1a) ridx = randi(N,size(v1)) v2 = v1a(ridx)

How can I generate values randomly from another existing vecor?

how about v1 = [122,34,20,5,21] v1a = [0,v1] N = numel(v1a) ridx = randi(N,size(v1)) v2 = v1a(ridx)

2 years ago | 1

| accepted