Answered
Subset Table using an array of strings
I think you want list_of_cols = {'col1' 'col2'} or list_of_cols = ["col1" "col2"] because list_of_cols as you wrote it ev...

2 years ago | 0

Answered
Can't use user input and eval() to add a row to a table within a structure.
First of all, this is not a good way to do things. In general, if you find yourself using eval, you should stop and rethink the ...

2 years ago | 1

| accepted

Answered
why if elseif statement is not working
This expression: va(i)>207 | va(i) <253 asks whether the value is greater than 207 or less than 253. All values (other than Na...

2 years ago | 0

| accepted

Answered
Calling table from matlab workspace as input for function
when you call a function, you're passing in some values to be used in the function. So when you have: [m1,m2]=IRmax(FILENAME,17...

2 years ago | 1

| accepted

Answered
Make x axis values not overlapping
You can make this kind of (multi-row) labelling work by relying on the TeX interpreter. Note this answer is a total rip-off of t...

2 years ago | 0

| accepted

Answered
3D array, remove columns where second array == -1
From what I can see here, you've got a logical vector called toRemove, and you want to remove columns where toRemove is true fro...

2 years ago | 1

| accepted

Answered
Using structures in functions within for loop
In your example, you have a bunch of values for V (i.e. a 1 x 10 vector) and single values (i.e. scalars) for A and B. Do you wa...

2 years ago | 0

Answered
Dynamically calling variables (it's not what this sounds like!)
I think, if I read your question correctly, you're saying: You have files with a suffix The suffix determines the names of var...

2 years ago | 0

| accepted

Answered
Save figures from for loop into a subfolder of the current folder.
To make the figures not appear, I'd set their Visible property to 'off' I'd also recommend exportgraphics on releases since 202...

2 years ago | 1

Answered
How to take ascii file and plot into scatter plot?
readtable will do well to read in the file converting it to categorical will make it easier to make a bar out of reordercats w...

2 years ago | 0

| accepted

Answered
extracting and filtering images from a 3D matrix?
If you have a 3d matrix, can you do this simpler approach? [edit: updated for the first dimension being slice/image] nfr = nan...

2 years ago | 0

Answered
How to group values in different indexes (in a matrix) together.
Yes, if you want 010 to not be 10, it can't be a double... You didn't describe what should happen with the last triplet, as 400...

2 years ago | 0

| accepted

Answered
A new figure is coming out while plotting inside a for loop in App designer.
Short answer, replace: grid on with grid(app.UIAxes_animation, 'on') Long answer, if you look at this section of code: ...

2 years ago | 0

| accepted

Answered
group numbers in cells
I think you're asking how to go from cells that have a sort of group-id in the first column to recombined cells that all have th...

2 years ago | 0

| accepted

Answered
What is '1butter' in this Wiener Filter code?
I'm guessing it's just supposed to be butter, there's no function in MATLAB called 1butter, and there couldn't be because number...

2 years ago | 0

Answered
remove rows in table based on different string across columns
You have a couple of bugs: You need to write contains twice: it's not contains(thing,otherthing) & thing2,otherthing2 but inste...

2 years ago | 0

| accepted

Answered
Merge all figures into one plot
tiledlayout and nexttile is a good alternative to subplot and gives you a little more control over the spacing between plots. It...

2 years ago | 0

Answered
How to create points in a matlab plot from cursor position click
What you're describing is a callback function that adds a point, here are the ingredients you'll need: a callback function: som...

2 years ago | 1

Answered
How to split a column matrix into N parts
reshape is a great way to do this: x=rand(100000,1); y=reshape(x,1000,100); y1=reshape(x,1000,[]); % Because the 100 is deter...

2 years ago | 1

| accepted

Answered
Add a .png Image multiple times in a graph
You can call image multiple times, specifying your x and y separately with a few caveats: You'll need hold on to prevent wiping...

2 years ago | 0

| accepted

Answered
can someone lead me how to make such a plot?
You can make plots like this with the errorbar function. However you'll have to think about the math that's appropriate to defin...

2 years ago | 0

Answered
Fill the area between two curves
I'm surprised that the solutions you tried didn't work... I think these are often easiest with fill, and I like to think of the...

2 years ago | 0

| accepted

Answered
Convert from Coordinated UTC to datetime?
You can do this easily with datetime: x=1.511092230713565e+05; % The date part is the part before the decimal, so use floor ...

2 years ago | 0

Answered
Is it possible to get minor grid lines to show when using datetime along x axis?
You can absolutely have minor grid/ticks with a datetime x axis, but you'll need to pick your own minor tick values: unixtime...

2 years ago | 1

Answered
Write cells to individual excel sheets
I think with xlswrite you specify just the sheet, no need to use the keyword 'sheet' xlswrite(Fnane, PD_adpt{ii}, sheet_names(i...

2 years ago | 0

Answered
If statement inside a while loop MATLAB
All of those else if should be elseif. https://www.mathworks.com/help/matlab/ref/if.html rainfall_values=[39.9 31.0 42.3 42....

2 years ago | 0

Answered
How to fill a 2D plot?
You can use the fill function to fill a region. You can retrieve the x and y values using real and imag (I don't think fill does...

2 years ago | 1

| accepted

Answered
How to plot a plot that has multi coordinates in one x coordinate?
A good strategy for these kinds of plots is to treat it as if the numbers are 1 to 15, and then just change the labels y=rand(1...

2 years ago | 0

| accepted

Answered
Taking Mean of Half Values Inside a Cell
I think you're saying that you have a matrix of values inside a cell in a cell array, but if I misunderstood please correct me (...

2 years ago | 0

| accepted

Answered
How do I write a line for adding a text to my plot?
The text function requires x and y values (or x, y, z values). Alternatively, use the title function if you want a title for yo...

2 years ago | 1

Load more