Community Profile

photo

Adam


1,726 total contributions since 2014

Professional Interests: Signal Processing, OOP, Matlab GUI programming, Machine Learning

Adam's Badges

  • 36 Month Streak
  • Thankful Level 2
  • Guiding Light
  • Revival Level 1
  • Knowledgeable Level 4
  • First Answer
  • Solver

View details...

Contributions in
View by

Answered
How to change the scale of the x-axis & y-axis?
doc interp2 is likely what you need if you want finer resolution to get rid of step-like features, but how was anyone to in...

3 hours ago | 0

Answered
loop for while etc
n = 0:100000; s = 0.5 * sin( n / 33 );

1 day ago | 0

Answered
Output argument 'y' is not assigned on some execution paths
I can't be bothered to manually check every single |if| condition, but that error is telling you that with some inputs you gave ...

4 days ago | 0

| accepted

Answered
how to form feedback loop to change input?
Put the relevant part of the code in a while loop with the condition while Dm < -1 || Dm > 1 % Your main code here ...

6 days ago | 0

| accepted

Answered
arrayfun with multiple inputs and a different size output
c = arrayfun( @(x,y) rand( x, y ), 1:4, 3:6, 'UniformOutput', false ) works fine to produce outputs that are matrices. If ...

7 days ago | 0

Answered
how to display colorbar levels from '-10^6' to '10^6' ?
c = colorbar; labels=arrayfun(@(c)['10^',int2str(c)],-6:6,'uniformoutput',false); set( c, 'TickLabels', labels, 'Tic...

7 days ago | 0

Answered
Creating a new string matrix
s = string( {'abc';'ef';'xyz'} ) or s = [ "abc";"ef";"xyz" ] work, but your start point there is not valid syntax ...

8 days ago | 0

| accepted

Answered
Copy the curve in the Axes of a Figure to the Axes of a GUI
If you have the handle of figure 1 as hFig then hLine = findobj( hFig.CurrentAxes, 'Type', 'line' ) or hLine = fin...

8 days ago | 1

| accepted

Answered
extracting first letter from the cell
res = cellfun( @(x,y) [x(1) y(1)], nam1, nam2, 'UniformOutput', false' ) works fine for me on your example, but then so doe...

8 days ago | 0

Answered
Parsing varargin for a function called with values only instead of name-value pairs
function add_to_database(db, bird, where, when) if ~isempty( bird ) bird = validatestring( bird, { 'robin', 'car...

13 days ago | 0

Answered
How to assign values to a sparse matrix without iterations?
i = repmat( 1:size( Nonloc ), [1 2] ); j = Nonloc(:) s = sparse( i, j, 1 );

14 days ago | 0

| accepted

Answered
Add values to vector
B( B == 1 ) = A

14 days ago | 0

Answered
How to combine two arrays?
[x; y]

14 days ago | 0

Answered
What is missing from MATLAB?
As a regular user of object oriented programming one of the things I miss most from C++ (where I started) is the ability to pass...

15 days ago | 0

Answered
How to change output ans?
doc format

18 days ago | 0

| accepted

Answered
How to maintain the same "xticks" and "yticks" for multiple plots?
doc linkaxes or doc linkprops if you need more fine control, but linkaxes should work fine, using the 'y' argument ...

20 days ago | 1

| accepted

Answered
Calling a function with 2 inputs using only a single input
It depends how you want to handle it. Do you want 'b' to be an optional argument or do you want to force the caller to always gi...

20 days ago | 1

| accepted

Answered
How to replace k-th diagonal by vector?
P is defined as a matrix of all zeros and you appear to be overwriting the 'diag' function with a variable of the same name whic...

21 days ago | 1

Answered
How can I color a (circle) area in a scatterplot?
doc scatter shows a 4-argument syntax which allows you to include a vector of colours of equal length to the x and y. So y...

22 days ago | 0

Answered
Why did I get the same value from radio button in a buttongroup?
You are always asking for the Selected object's 'Value'. This will always return 1 because it is the selected object. You sh...

26 days ago | 0

| accepted

Answered
GUIDE - How to use variables that are calculated in Button 1, in Button 2?
<https://uk.mathworks.com/help/matlab/creating_guis/share-data-among-callbacks.html> This gives various different methods and...

27 days ago | 0

| accepted

Answered
Find indices of points in meshgrid-like data
[~, index] = ismember( A, [X(:) Y(:)], 'rows' ); Not sure if that is any faster than a loop though. ismember is not a very...

27 days ago | 0

| accepted

Answered
How to reshape a cell array ?
cellfun( @(x) x + zeros( 95, 1 ), ESS_estimated_schedule, 'UniformOutput', false ); It seems like rather large replication ...

29 days ago | 0

Answered
How to Change the Fill Color of the Box in a Box Plot?
Unfortunately boxplot seems to be one of those unpleasant plotting functions that returns nothing and gives you no easy way to c...

29 days ago | 0

Answered
how do i change units of xaxis and yaxis without changing the plot??
If you are using a sufficiently new Matlab then you can use hAxes.XAxis.Exponent = 0; for an axes handle, hAxes, to get ...

29 days ago | 0

Answered
How to catch warnings?
<https://undocumentedmatlab.com/blog/trapping-warnings-efficiently> may help with this. Credit to Guillaume from <https://uk...

1 month ago | 1

Answered
Determining whether an angle is between two other angles
RayCat = sign( az_ray - mod( gamma1, 360 ) ) == sign( mod( gamma2, 360 ) - az_ray ); looks like it would do the job.

1 month ago | 1

Answered
how to insert the workspace near the editor?
On the Home ribbon there is a 'Layout' dropdown list about 2/3 of the way along. Tick 'Workspace' on its list and then you can ...

2 months ago | 0

| accepted

Load more