Community Profile

photo

Adam Danz


Last seen: Today

University of Rochester

2,781 total contributions since 2014

Email: feel free to contact me regarding my shared files on the file exchange. I don't do free consulting outside of the forum so if you have a Matlab question, post the question to the forum and you may email me the link to the question.

About me: Finishing PhD soon on topics related to vision science; neurophysiology; sensory-motor feedback and control; control systems; steering & navigation; multisensory integration; top-down bottom-up feedback loop.

"If I had only one hour to save the world, I would spend fifty-five minutes defining the problem, and only five minutes finding the solution." -Albert Einstein

"An expert is a person who has made all the mistakes that can be made in a very narrow field." -Niels Bohr

"If you are not embarrassed by the first version of your product, you've launched too late" - Reid Hoffman

Contact

Adam Danz's Badges

  • Thankful Level 4
  • 24 Month Streak
  • Personal Best Downloads Level 4
  • Explorer
  • Ace
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 5
  • First Submission
  • Revival Level 3
  • Knowledgeable Level 4
  • Solver
  • First Answer

View details...

Contributions in
View by

Answered
Shift columns of a matrix with different values
Method 1: indexing with rem This method shifts values rightward in each row of the nxm matrix A by the amounts specified in vec...

1 day ago | 1

| accepted

Answered
intersection area of 3 or more rectangles
This approach is inspired by the even-odd rule for determining if a point is inside a polygon. If the max left-edge value is sm...

1 day ago | 0

| accepted

Answered
overtop IMAGESC text and change colorbar colors in white for some value of the text
The 0.0% values are rounded to 1dp so any values between -0.049 and 0.049 will show 0.0%. So, you need to find the indices of f...

1 day ago | 1

Answered
subplot aligment automatic method
Method 1: equate axis sizes for all axes after adding colorbar Size of axes without a colorbar will be set to the size of axes ...

1 day ago | 0

Answered
Can I create a drop down menu in App Designer in which the drop down items reference a cell array?
The handle to the dropdown menu must be available in the same workspace that updates the cell array. If that's done in AppDesig...

2 days ago | 0

| accepted

Answered
how to define a gradient colormap
You need to define the colorscale using caxis. caxis([-1,1]) to apply to all axes, arrayfun(@(h)caxis(h,[.2,.6]),ax) % ax i...

2 days ago | 0

Answered
Date formats 'uuuu' vs 'yyyy', 'mm' vs 'MM'
The confusion is warranted and due to inconsistencies in Matlab's date-time formats. datetime format uses MM/mm for months/min...

2 days ago | 0

| accepted

Answered
Plot Cook’s distance for mixed effects model
plotDiagnostics is a public method of the LinearModel class. The function is defined in LinearModel.m and recieves a LinearMod...

2 days ago | 1

Answered
Heat Map Cell values display
The imagesc demo in this answer produces a plot nearly identical to a heatmap and the last line allows you for format the cell l...

4 days ago | 0

| accepted

Answered
Create and fill cell array with differntly sized arrays within a function
The size and shape of data you're working with is not clear but I'm guessing from the first for-loop in your question that dat...

4 days ago | 1

| accepted

Answered
What is best practice to determine if input is a figure or axes handle?
I find myself revisiting this page from time to time and wanted to share an alternative best practice to determine if an array o...

4 days ago | 0

Answered
How do I prevent the pointer change when I bring the mouse cursor to a graph in a figure? (Regarding the mouse pointer update in r2020a)
To prevent the datatip cursor from appearing when hovering over a graphics object, fig = figure(); fig.PointerMode = 'manual'...

4 days ago | 1

Answered
Changing axes linewidth on a stacked plot
You have to access the axis handles first. h = stackedplot(rand(10,4)); ax = findobj(h.NodeChildren, 'Type','Axes'); % use ...

8 days ago | 0

Answered
Random generator with constraints
> I am getting back into MATLAB and need to create a random generator that provides a matrix of 12 rows by 4 colums of numbers f...

8 days ago | 0

| accepted

Answered
Matlab Zeros, What type of matrix will I get from this?
> could someone tell me what do I get from this operation Assuming your variables are scalar (1 value) or, when multipled, pro...

8 days ago | 0

| accepted

Answered
How to find average monthly wind velocity values for given years?
Use groupsummary to compute the means for 12 months across all days/years. Demo: T = table((1:10)', randi(12,10,1), 2017.*one...

8 days ago | 0

| accepted

Answered
How to draw bar graph of different colors ?
This has been addressed in the forum many times. Examples: https://www.mathworks.com/matlabcentral/answers/553894-barcharts-...

8 days ago | 1

Answered
How use pcshow in GUI
The error message indicates "Functionality not supported with UIAxes". Also, the documentation for the Parent property in pcsho...

9 days ago | 0

Answered
Change background color of uitable row name fields
In Matlab r2019b and later, use addstyle() to control color of cells in a uitable. The uitable must be within a uifigure (such ...

11 days ago | 0

Answered
How to move the data to the right
It sounds like you need to shift the data to the right by adding a constant value to the x-coordinates and then assign the orgin...

11 days ago | 0

Answered
Loop for concentric squares
Vectorized version, sz = 20; % matrix size, square, positive integer difference = 2; % width of bands, positive inte...

11 days ago | 0

| accepted

Answered
get a field value from all elements of a structure
z = [s.A.B];

13 days ago | 0

| accepted

Answered
Alternative for nested for loop
> Is there a simpler way to do this? As long as you're preallocating the JV cell array, your approach is very simple, fast, and...

14 days ago | 1

| accepted

Answered
find intersection points of a line and a curve.
There are several ways to get the x values at each intersection of the y-value. The simplest solution is to use the intersection...

14 days ago | 2

| accepted

Answered
Data is not contained within x-axis limits
Get the handle to the line object and look at the Clipping property. If it's set to 'off' figure out what part of the code chan...

14 days ago | 0

Answered
progress bar in app design (GUI)
Step 0: Set up the app button Add a button to your app and add a ButtonPushed callback function. Importantly, the height of th...

15 days ago | 0

| accepted

Answered
Change title in anovan boxplot
% Generate table y = [52.7 57.5 45.9 44.5 53.0 57.0 45.9 44.0]'; g1 = [1 2 1 2 1 2 1 2]; g2 = {'hi';'hi';'lo';'lo';'hi';'hi'...

16 days ago | 0

| accepted

Answered
How do I change datetime format in stackedplot on X-Axis?
In case anyone is still looking for this solution, % Create stacked plot, set xdata as datetime values % The XData can also ...

16 days ago | 0

Answered
How can I get DataCursor information from stackedPlot on ButtonDown callback function?
This solution uses undocumented methods of obtaining the data tip lables (see inline comments). As with all undocumented approa...

16 days ago | 2

| accepted

Answered
Can I make sound and soundsc not make a sound when playing a constant value?
> I was exploring what a ramp sounds like [using 1:10000] I think you're interpretting the audio data incorrectly but to your d...

17 days ago | 2

| accepted

Load more