Answered

How to add the value of the 3 highest elements automatically from a vector?

like this? [~,idx] = maxk(y,3) y(idx) = y(idx) + sx Are x1 and x2 irrelevant to your question?

How to add the value of the 3 highest elements automatically from a vector?

like this? [~,idx] = maxk(y,3) y(idx) = y(idx) + sx Are x1 and x2 irrelevant to your question?

8 dagar ago | 0

Answered

How to map a vector to a colourmap ?

A brute force way would be to interpolate...not sure if there's a better way x = % ... data vector indices = 0:255; xref = ...

How to map a vector to a colourmap ?

A brute force way would be to interpolate...not sure if there's a better way x = % ... data vector indices = 0:255; xref = ...

12 dagar ago | 1

| accepted

Answered

Making a square figure with pcolor

Your coordinate grid matrices x and y are not "aligned" with the axes. You can see this if you just do plot3(x,y,zeros(size(x)...

Making a square figure with pcolor

Your coordinate grid matrices x and y are not "aligned" with the axes. You can see this if you just do plot3(x,y,zeros(size(x)...

19 dagar ago | 0

Answered

Getting Cell location of checkboxes on selection (UITable)

Is it as simple as defining a CellEditCallback?

Getting Cell location of checkboxes on selection (UITable)

Is it as simple as defining a CellEditCallback?

22 dagar ago | 0

| accepted

Answered

Is there an automatic way to find the centre of this circularly-symmetric pattern?

This would be not at all efficient and maybe not robust, but you could pose a minimization problem: Find the coordinates (Xc,Yc...

Is there an automatic way to find the centre of this circularly-symmetric pattern?

This would be not at all efficient and maybe not robust, but you could pose a minimization problem: Find the coordinates (Xc,Yc...

24 dagar ago | 0

Answered

How can I create binEdges?

It looks like your problem is not with binning, but the fact that you have NaN's in your data. By the way if you have 2014b or ...

How can I create binEdges?

It looks like your problem is not with binning, but the fact that you have NaN's in your data. By the way if you have 2014b or ...

24 dagar ago | 0

| accepted

Answered

Extracting particular x and y data points from a figure

Thinking in terms of graphs is useful but only takes you so far. The point is how to think about the data and/or functions under...

Extracting particular x and y data points from a figure

Thinking in terms of graphs is useful but only takes you so far. The point is how to think about the data and/or functions under...

24 dagar ago | 0

| accepted

Answered

Help in implementing ode45 in app designer

Static methods don't assume that the app is passed as the first argument, so remove "app" from the arg list methods (Static) ...

Help in implementing ode45 in app designer

Static methods don't assume that the app is passed as the first argument, so remove "app" from the arg list methods (Static) ...

27 dagar ago | 0

Answered

Validate and get exact number of characters using the regular expression

Try out_str = regexp(str, '[A-Z]+-[0-9]{2}$', 'match');

Validate and get exact number of characters using the regular expression

Try out_str = regexp(str, '[A-Z]+-[0-9]{2}$', 'match');

28 dagar ago | 1

| accepted

Answered

How to initialize a new matrix of the same type as an existing variable?

I am not sure if this works for symbolic type, but you can initialize an array of arbitrary type by specifying the "last" elemen...

How to initialize a new matrix of the same type as an existing variable?

I am not sure if this works for symbolic type, but you can initialize an array of arbitrary type by specifying the "last" elemen...

30 dagar ago | 0

Answered

How to remove outliers based on datetime

What if you ran statistics on real or integer representations of datetime, using datenum() or something?

How to remove outliers based on datetime

What if you ran statistics on real or integer representations of datetime, using datenum() or something?

ungefär en månad ago | 0

Answered

lsqcurvefit initial point is always a local minimum, relative first-order optimality is always = 0

I think you have a typo here: F = @(v,cur_data_wave_x) amplitude*(offset + cos(v0(1)*(cur_data_wave_x) + v0(2))); should rathe...

lsqcurvefit initial point is always a local minimum, relative first-order optimality is always = 0

I think you have a typo here: F = @(v,cur_data_wave_x) amplitude*(offset + cos(v0(1)*(cur_data_wave_x) + v0(2))); should rathe...

ungefär en månad ago | 0

| accepted

Answered

Applying a for loop to every column in a vector

Agree with KSSV, avoid naming as "max", but in this case it is not causing your problem. Your problem is that "index" should no...

Applying a for loop to every column in a vector

Agree with KSSV, avoid naming as "max", but in this case it is not causing your problem. Your problem is that "index" should no...

ungefär en månad ago | 0

Answered

How to choose 5 random rows from an array of 8 rows for 10 times and save the 10 results

if order doesn't matter (6,4,8,7,2 is the same as 4,6,8,7,2) doc nchoosek if order does matter (6,4,8,7,2 is different from 4,...

How to choose 5 random rows from an array of 8 rows for 10 times and save the 10 results

if order doesn't matter (6,4,8,7,2 is the same as 4,6,8,7,2) doc nchoosek if order does matter (6,4,8,7,2 is different from 4,...

ungefär en månad ago | 1

| accepted

Answered

solving a second spatial derivative using ode45

This comment is incorrect: % Create a two element vector that holds the derivative equations of u and % v % U(1) is u and U(2...

solving a second spatial derivative using ode45

This comment is incorrect: % Create a two element vector that holds the derivative equations of u and % v % U(1) is u and U(2...

ungefär en månad ago | 0

Answered

How to save file on chosen path in app designer?

can you just simplify and use uiputfile()?

How to save file on chosen path in app designer?

can you just simplify and use uiputfile()?

ungefär en månad ago | 0

Answered

Implicit Boundary Value Problem

Ok, so looks like what you are after is solving a DAE that has BCs at more than one boundary. Docs say it is ode15s and ode23t ...

Implicit Boundary Value Problem

Ok, so looks like what you are after is solving a DAE that has BCs at more than one boundary. Docs say it is ode15s and ode23t ...

ungefär en månad ago | 0

| accepted

Answered

Select mxm matrix from mxn matrix and solve systems of linear equations

Does this help with first problem: https://www.mathworks.com/help/matlab/ref/nchoosek.html Second problem, maybe make tolerance...

Select mxm matrix from mxn matrix and solve systems of linear equations

Does this help with first problem: https://www.mathworks.com/help/matlab/ref/nchoosek.html Second problem, maybe make tolerance...

ungefär en månad ago | 1

| accepted

Answered

Reduce time execution in a real time serial data reading

If instead of a loop, you use a timer (https://www.mathworks.com/help/matlab/matlab_prog/use-a-matlab-timer-object.html), you mi...

Reduce time execution in a real time serial data reading

If instead of a loop, you use a timer (https://www.mathworks.com/help/matlab/matlab_prog/use-a-matlab-timer-object.html), you mi...

ungefär en månad ago | 0

Answered

how to generate text file from generated output

fprintf() accepts as 1st argument a file identifier for a file opened with fopen(). fid = fopen("somefile","w") fprintf(fid,...

how to generate text file from generated output

fprintf() accepts as 1st argument a file identifier for a file opened with fopen(). fid = fopen("somefile","w") fprintf(fid,...

ungefär en månad ago | 0

Answered

App designer: Enable mouse scroll to change value on slider

Take a look at the UIFigure's following properties: WindowScrollWheelFcn WindowKeyPressFcn WindowKeyReleasedFcn If you need ...

App designer: Enable mouse scroll to change value on slider

Take a look at the UIFigure's following properties: WindowScrollWheelFcn WindowKeyPressFcn WindowKeyReleasedFcn If you need ...

ungefär en månad ago | 0

| accepted

Answered

Trying to identify directions of overlapping lines in images, at my wit's end

Have you looked into radon transforms? You might get some "signal" at the 45 and 135 directions for the right image... If these...

Trying to identify directions of overlapping lines in images, at my wit's end

Have you looked into radon transforms? You might get some "signal" at the 45 and 135 directions for the right image... If these...

ungefär en månad ago | 1

| accepted

Answered

Comparing terms in a character array

If it is truly a "character array" and you want exact matches only, you can use the findstr() command, which will return empty i...

Comparing terms in a character array

If it is truly a "character array" and you want exact matches only, you can use the findstr() command, which will return empty i...

ungefär 2 månader ago | 0

| accepted

Answered

Web app system command

To the question: Also, an other question just came to my mind: what's the best practice to store permanent data and access them...

Web app system command

To the question: Also, an other question just came to my mind: what's the best practice to store permanent data and access them...

ungefär 2 månader ago | 0

Answered

Getting data from the figure in appdesigner

Here's an example where I used the data cursor's update function itself to collect the coordinates and feed directly into your a...

Getting data from the figure in appdesigner

Here's an example where I used the data cursor's update function itself to collect the coordinates and feed directly into your a...

ungefär 2 månader ago | 1

Answered

reshaping multi dimensional array and central difference method

Based on your example lines, you seem to have the further simplification that your delta x and delta y are uniform (in your exam...

reshaping multi dimensional array and central difference method

Based on your example lines, you seem to have the further simplification that your delta x and delta y are uniform (in your exam...

ungefär 2 månader ago | 1

| accepted

Answered

Filter a table based on date (Error using tabular/dotParenReference (line 95) Unrecognized row name '01/00/0000'.)

The second way is almost right, but when you use () on testtable, you are extracting a subtable, rather than the datetime array ...

Filter a table based on date (Error using tabular/dotParenReference (line 95) Unrecognized row name '01/00/0000'.)

The second way is almost right, but when you use () on testtable, you are extracting a subtable, rather than the datetime array ...

ungefär 2 månader ago | 1

| accepted

Answered

Using a image variable from one GUI function to another in AppDesigner

Create a property for your app class to hold the image. You appear to be using appdsigner. In appdesigner's code view, on the l...

Using a image variable from one GUI function to another in AppDesigner

Create a property for your app class to hold the image. You appear to be using appdsigner. In appdesigner's code view, on the l...

ungefär 2 månader ago | 1

| accepted

Answered

Plot a curve with its derivatives

As far as I know, matlab's plot function will draw a straight line (linear interpolation) between adjacent points. For your cas...

Plot a curve with its derivatives

As far as I know, matlab's plot function will draw a straight line (linear interpolation) between adjacent points. For your cas...

2 månader ago | 0

Answered

Generate matrix of precise length and in ascending order

This seems to work, and is less wasteful RowSum = 10; NCols = 4; NRows = 70000; A = randi(floor((RowSum-2)/(NCols-2)),[NRo...

Generate matrix of precise length and in ascending order

This seems to work, and is less wasteful RowSum = 10; NCols = 4; NRows = 70000; A = randi(floor((RowSum-2)/(NCols-2)),[NRo...

2 månader ago | 0