Answered
Help with for loop and invalid expression
The line of code a(i,j)=(t,x); doesn't make sense. a(i,j) is a location in a matrix, namely the ith row and jth column of th...

4 years ago | 0

Answered
How do you set a variable name to a variable value?
You can do this with eval, but you are likely to regret this. a = 'Pi'; val = pi; eval(a + " = " + val); This link has some...

4 years ago | 0

| accepted

Answered
How to declare a function as Static if it is defined as an individual file under the class folder?
You can do exactly what you're describing. The trick (if there is one) is that you leave the keyword function out in the classde...

4 years ago | 0

Answered
How to separate two graphs plotted in one figure into two separate figures?
Is neural.Spikes two columns? If so: figure; nexttile % starting in R2019b, in older versions subplot(1,2,1) plot(neural.Ti...

4 years ago | 0

| accepted

Answered
Logical comparison between two tables
As a quick answer, yes, you just use <= to compare the two matrices You can take the 1s and 0s that result from doing the compa...

4 years ago | 0

| accepted

Answered
How to use the same color scheme but different FaceAlpha in bar graphs with hold on?
A few options, depending on where you might head next: Option 1: By default, bar is going to use the ColorOrder from the axes...

4 years ago | 0

Answered
How can I calculate the pixel value (gray level) in a ROI?
The average pixel value in an roi? % This code would be the average of pixels in a square, rows 10-20, columns 20-30 mean2(gra...

4 years ago | 0

| accepted

Answered
Trying to create a multidimensional array
I'm not 100% sure I follow the goal, the code you've pasted appears to make g matrices, each with h columns and the number of ro...

4 years ago | 1

| accepted

Answered
can I find a solution for this integral?
When I run this code with scalar x,y it works fine: x=2;y=2; r=sqrt(x.^2+y.^2); theta=atan2(y,x); ab1=1;xi=2;n=10; h=@(t) ...

4 years ago | 0

| accepted

Answered
Why do spikes in the negative range disappear after filtering with filtfilt?
Your tutorial looks amazing! I suspect this isn't the fact that they're negative, to check that: can you multiply the values b...

4 years ago | 0

Answered
Readtable / writematrix / Excel file - how to control the format of variables in the table ?
@Marc Servagent For the reading part, there's an example that's fairly similar to this on the readtable documentation page enti...

4 years ago | 0

Answered
Get max or min value from a mesh plot interactively?
Without implementing something to draw the rectangle and display the result, you can get this with an extra step or two using br...

4 years ago | 0

| accepted

Answered
How do I display certain data on top of others using multiple Scatter plots
You can manipulate the stacking order in the axes by changing the order of the axes children vector or using the ustack function...

4 years ago | 0

| accepted

Answered
How to use tkinter (or alternatives) in my MATLAB program ?
The easiest way to get started with this is probably using 'App Desiginer' Which you can find by clicking 'Design App' under the...

4 years ago | 1

| accepted

Answered
function with multiple intervals
When you write x = (0:0.4:4)' % if 0<= x && x< 1 ... end MATLAB sees: if the number zero is less than the list of values 0...

4 years ago | 1

| accepted

Answered
How can I separate a sorted array into multiple at points referenced by another array?
The discretize function (or the third output of thie histcounts function) is good for this kind of problem (it'll do the > and <...

4 years ago | 0

Answered
How can one draw a plot of this table?
If you want a simple line plot, you could do plot(T.date, T.visitors) hold on plot(T.date, T.sales) or plot(T.date, [T.visi...

4 years ago | 0

| accepted

Answered
Grouped bar graph with individual datapoints
I think you have most of the info you need to plot the points, as you already found the XEndPoints property which really simplif...

4 years ago | 2

| accepted

Answered
cell array to double
@Robert Scott - I think the key to understanding this is that anything can be in a cell: a={'1' 2 datetime(2010,1,1) axes "one"...

4 years ago | 0

Answered
How can I use plotmatrix over UIAxes in app designer?
AutoResizeChildren is a property on the UIFigure, not the UIAxes. If you select app.UIFigure in the Component Browser you'll s...

4 years ago | 0

| accepted

Answered
Table in Guide, Start number
The property you are looking for is "RowName" If you want to change it programatically, and hTable is your table, you could do...

4 years ago | 0

| accepted

Answered
create a cell array of N dimensions of type char
A cell array has type cell, but you can use repelem/repmat to make a cell array where each cell contains an empty char: If yo...

4 years ago | 0

Answered
Not Enough Input Argument for loop in the outer shell of a nested function
Christine: It looks the place where you're calling MotionBasedMultiObjectTrackingExample needs to pass in the argument. It appea...

4 years ago | 0

Answered
Problem with plotting result
I'm not sure if this is what you're looking for? (I just looked at your plotting code, not at the math): clf scatter(x, xy, 'f...

4 years ago | 0

Answered
How to generate colormap for specific matrix?
I'm not 100% sure I understand the quesiton but here's how I interpreted it: There's a map that goes from a set of raw values t...

4 years ago | 0

| accepted

Answered
Colorbar spacing issue using tiledlayout
@Sebastian - For the first bit, that looks frustrating! When I tried the same code (also in R2021a) the colorbar's label was not...

4 years ago | 0

Answered
How can I change the width of a tile in a tiledlayout without changing its height?
I can think of a couple of easy options, depending on where the space should go: Option 1, use pbaspect on the axes. This wil...

4 years ago | 0

Answered
How can I preserve the figure information?
How about exporting to a file and importing that file in visio? Depending on what format visio likes best (I suspect svg), a...

4 years ago | 1

| accepted

Answered
loop iteration of table in excel
How about writetable? It has a 'Sheet' option: t=readtable('patients'); t2=readtable('morePatients') writetable(t,'foo.xls','...

4 years ago | 0

Answered
Cell array formatting /restructuring
eyko - In your data file there are several rows that begin with a number, I wasn't sure how you'd interpret those. Here's an e...

4 years ago | 1

Load more