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

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

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

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

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

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

6 months 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)

6 months ago | 1

| accepted

Answered

Probelm with web app server

@Martin Andersson, hope you have resolved this by now as it has been over a month, but if not, check your windows service accoun...

Probelm with web app server

@Martin Andersson, hope you have resolved this by now as it has been over a month, but if not, check your windows service accoun...

6 months ago | 1

Answered

How to find duplicate file names(same name but different folder address), and write those files in excel with their respective folder address?

Here's a way that doesn't require as many loops and calls to ismember % % uncomment to simulate the results of dir and test % ...

How to find duplicate file names(same name but different folder address), and write those files in excel with their respective folder address?

Here's a way that doesn't require as many loops and calls to ismember % % uncomment to simulate the results of dir and test % ...

7 months ago | 0

Answered

Get all allowed values of a class property

Ah, I should more fully embrace the validator mechanism. Here is a way by defining a custom validator, so in a way less hard-cod...

Get all allowed values of a class property

Ah, I should more fully embrace the validator mechanism. Here is a way by defining a custom validator, so in a way less hard-cod...

7 months ago | 2

Answered

web() and inputdlg() in App Designer

i think you can get around both limitations with some extra coding...never tried it, and just a thought, but... you could proba...

web() and inputdlg() in App Designer

i think you can get around both limitations with some extra coding...never tried it, and just a thought, but... you could proba...

8 months ago | 0

Answered

Want to connect 3D scattered data points with line

On way is to do it in a loop. After your code, hold on d = zeros(size(x)); % to hold distances from the first point for i =...

Want to connect 3D scattered data points with line

On way is to do it in a loop. After your code, hold on d = zeros(size(x)); % to hold distances from the first point for i =...

8 months ago | 1

Answered

Concentric Squares with matricies

Try looking into padarray (or arraypad I can't remember...). I think you can apply successively to achieve what you want

Concentric Squares with matricies

Try looking into padarray (or arraypad I can't remember...). I think you can apply successively to achieve what you want

8 months ago | 0

| accepted

Answered

Storing a loop index value in a dynamic array?

Without trying to get into the weeds of your need, did you know that "unique" can additionally output indices into each argument...

Storing a loop index value in a dynamic array?

Without trying to get into the weeds of your need, did you know that "unique" can additionally output indices into each argument...

8 months ago | 1

| accepted

Answered

Extract data from a timetable excluding an specific date

This should work. Most of these steps should be straightforward..."ismember" may have been the key tt_1 = timetable(datetime({'...

Extract data from a timetable excluding an specific date

This should work. Most of these steps should be straightforward..."ismember" may have been the key tt_1 = timetable(datetime({'...

8 months ago | 0

| accepted

Answered

Save plot as logical matrix array with same dimensions as original?

are you looking for imwrite()? or some combination of getframe(), frame2im(), and imwrite()?

Save plot as logical matrix array with same dimensions as original?

are you looking for imwrite()? or some combination of getframe(), frame2im(), and imwrite()?

8 months ago | 0

Answered

multiple isntances of custom ChartContainer in a figure

Oops, documentation says that the Parent of an instance of chartcontainer can only be one of Figure object (default) | Panel ob...

multiple isntances of custom ChartContainer in a figure

Oops, documentation says that the Parent of an instance of chartcontainer can only be one of Figure object (default) | Panel ob...

9 months ago | 0

| accepted

Question

multiple isntances of custom ChartContainer in a figure

I defined a custom matlab.graphics.chartcontainer.ChartContainer class. When trying to populate a uigridlayout with multiple in...

9 months ago | 1 answer | 0

Answered

Copy and re-arrange data from one column into another

Is this what you are looking for? load("~/Downloads/Sample_table_MatLab.mat") a = ["CG", "CG_LOW", "CG_HGH", "MLD", "MLD_LOW...

Copy and re-arrange data from one column into another

Is this what you are looking for? load("~/Downloads/Sample_table_MatLab.mat") a = ["CG", "CG_LOW", "CG_HGH", "MLD", "MLD_LOW...

9 months ago | 0

| accepted

Answered

plot 2 different time data on the same axis in same graph

To overcome the merged legend issue, you can create an empty plot to make the legend entry T = readtable('TIMEDATA.txt'); fi...

plot 2 different time data on the same axis in same graph

To overcome the merged legend issue, you can create an empty plot to make the legend entry T = readtable('TIMEDATA.txt'); fi...

9 months ago | 0

| accepted

Answered

plot 2 different time data on the same axis in same graph

or potentially you are just looking for "hold on"

plot 2 different time data on the same axis in same graph

or potentially you are just looking for "hold on"

9 months ago | 0

Answered

Calculating number of elements of a vector greater or equal than elements of other vector

R = rand(1,10000); losses = sort(rand(1,2000)); for i = numel(losses):-1:1 counts(i) = sum(R >= losses(i)) end

Calculating number of elements of a vector greater or equal than elements of other vector

R = rand(1,10000); losses = sort(rand(1,2000)); for i = numel(losses):-1:1 counts(i) = sum(R >= losses(i)) end

9 months ago | 1

| accepted

Answered

Discrepancy with easy ODE.

You have a syntax error on what your odefun is returning. To fix: function [yp]=fun(t,y) yp=y*(1-y); end

Discrepancy with easy ODE.

You have a syntax error on what your odefun is returning. To fix: function [yp]=fun(t,y) yp=y*(1-y); end

10 months ago | 0

| accepted

Answered

Creating iteration to make CSVs that do not overwrite

I agree with Ive J and their solution will work, but if N>9, you may want to include leading zeros. I'm not sure how to do that ...

Creating iteration to make CSVs that do not overwrite

I agree with Ive J and their solution will work, but if N>9, you may want to include leading zeros. I'm not sure how to do that ...

10 months ago | 1

| accepted

Answered

Solve differential equation system with ode45

If you want to use ode45, then you have to pose as 5 first order ODEs in place of the 3 you have, by defining new variables J=G'...

Solve differential equation system with ode45

If you want to use ode45, then you have to pose as 5 first order ODEs in place of the 3 you have, by defining new variables J=G'...

10 months ago | 0

Answered

Solving complicated system of symbolic equations

I like John's comment about visualizing. To expand on this, and Walter's comment that it is trickier to do this in the complex p...

Solving complicated system of symbolic equations

I like John's comment about visualizing. To expand on this, and Walter's comment that it is trickier to do this in the complex p...

10 months ago | 0

Answered

Select random numbers from matrix without repetition

And here is a different approach to the contiguous blocks. Instead of checking for overlaps, you can avoid them by tagging eleme...

Select random numbers from matrix without repetition

And here is a different approach to the contiguous blocks. Instead of checking for overlaps, you can avoid them by tagging eleme...

10 months ago | 0

Answered

Select random numbers from matrix without repetition

Here is a simple way if you don't need contiguous blocks, but just need to randomly sample elements without repeating L = 1024;...

Select random numbers from matrix without repetition

Here is a simple way if you don't need contiguous blocks, but just need to randomly sample elements without repeating L = 1024;...

10 months ago | 0

Answered

readtable (excel) behavior for string type with empty cell vs spaces

According to Jemima's answer, confirmed that the issue is an internal conversion of the "" to <missing> within readtable. Furthe...

readtable (excel) behavior for string type with empty cell vs spaces

According to Jemima's answer, confirmed that the issue is an internal conversion of the "" to <missing> within readtable. Furthe...

10 months ago | 0

| accepted

Answered

Split datetime column data into two column

if you import it as a datetime variable, you can use datetime operations to render into whatever format you want, including one ...

Split datetime column data into two column

if you import it as a datetime variable, you can use datetime operations to render into whatever format you want, including one ...

10 months ago | 0