Answered
How to get scale and coordinates from quiver function?
> the particles have new locations [X1, Y1]. Is there a way to get this new location data? If you already have the X, Y, U and...

3 years ago | 1

| accepted

Answered
My function won't accept the vector
Perhaps you're looking for x = 0:1:10; f = x.^2-x-1;

3 years ago | 1

Answered
Detect when UIfigure is open
MATLAB currently does not return an indication that rendering is complete but you could use a MATLAB function that requires rend...

3 years ago | 0

Answered
Value of cross correlation in matlab?
You could compute the cross correlation at 0 lag using r = xcorr(___,scaleopt) where scaleopt can be set to a normalization opti...

3 years ago | 1

| accepted

Answered
Export figure using print with variable as the file name
Use exportgraphics (or another function export function, if needed) and define the filename using sprintf. Example: fig = fi...

3 years ago | 2

| accepted

Answered
Error converting string into cell array
> Sources is an image, however I just need the name of it stored in the matrix Assuming sources is a string or character vecto...

3 years ago | 0

| accepted

Answered
How to create a matrix whose elements are a function of previous elements
This solution has two "inputs", initialMatrix and nRows and produces the output matrix out which has the same number of rows spe...

3 years ago | 0

| accepted

Answered
How do I change a string object into a variable name that heatmap accepts
If nchoosek returns a cell array of strings, you can index them using { } try this. heatmap(engine_config, group_perms{i,1}, g...

3 years ago | 0

| accepted

Answered
Overlay some line plots selectively from different .fig files in Matlab?
> Is there a better way to merge plots systematically? The color of the lines and markers in your plots were intentionally set ...

3 years ago | 2

| accepted

Answered
How to set the number of digits in a .txt file?
If you're using these values as numeric values, then you don't need the leading 0 since 056 is the same as 56. If you're usin...

3 years ago | 0

| accepted

Answered
Find the percentage of area occupied by an object
Assuming that this is an image and that the pink color is a single RGB color value, you could compute the number of pixels with ...

3 years ago | 1

Answered
block plotting a figure
This is a common problem which often arises from functions that produce sanity-check visualizations or other windows to underlyi...

3 years ago | 1

Answered
Shutdown at specific time
This solution displays a confirmation dialog that indicates to users that MATLAB will close unless they decide to cancel the aut...

3 years ago | 0

Answered
Change the position of a pie chart
The solution below rotates the set of objects that create a pie chart by using an hgtransform. The text label alignment needs...

3 years ago | 0

Answered
Undefined function 'imsegkmeans' for input arguments of type 'uint8'.
imsegkmeans accepts uint8 values which means either You don't have the image processing Toolbox, or You are using a MATLAB re...

3 years ago | 0

| accepted

Answered
Cell entries as the third dimension of the cell2mat matrix.
Compute B outside of the loop for k=1:N for j=1:N A{k,j}=S(:,j).*D(k,:).'; end end B = permute(reshape(hor...

3 years ago | 0

| accepted

Answered
Disable help tips in app designer
Setting preferences to control suggestions and completions From the MATLAB Environment, go to the Home tab, and open Preferen...

3 years ago | 0

| accepted

Answered
Pop-ups don't appear when starting from AppDesigner
After reducing your startup function to the following, I could not reproduce the results in MATLAB R2022a. function startup(a...

3 years ago | 0

Answered
Histogram (with sum of variables on y-axis)
Hello Vlatko, I'm not sure if you want to sum the two vectors and then compute the binned sum or if you want to compute the bi...

3 years ago | 0

| accepted

Answered
How can convert line plot to bar plot
It appears you're looking for bar(x) or bar(x.') depending on how you'd like to group the bars.

3 years ago | 0

Answered
I want to take a training in matlab
Here are free tutorials to start learning MATLAB or Simulink. Select the "MATLAB Onramp" to get started with MATLAB. https://...

3 years ago | 0

Answered
colored isosurface could not be maintained
Why do the isosurface colors change when adding another surface object? By default, the range of colors in the axes' colormap i...

3 years ago | 0

| accepted

Answered
Toggle grid on off when user selects in a GUI
Great question. The funcion gca gets the current axes which is the axes most recently in focus. Instead, you want to specify w...

3 years ago | 1

Answered
Find the number of non-empty cells in each row of a cell array
Here's a demo that creates a cell array of tables and empty cells determines which cells contain a table counts the number o...

3 years ago | 1

| accepted

Answered
Making a heat map from three vectors of different lengths
In heatmap, XData define the number of columns and YData define the number of rows. Your matrix y is 21x10 meaning there will b...

3 years ago | 0

| accepted

Answered
Heatmap doesnt show empty rows or columns
By empty I assume you mean that there are NaN values present and I see that you are setting a missing data value color and label...

3 years ago | 0

Answered
Plotting Row and Columns
There are important items to address here. 1. Creating new figures if mod(n,10) == 0 %checks whether Remainder after divisio...

3 years ago | 1

| accepted

Answered
How can I show the legend to all bars?
Your bar() command specifies "stacked" but since your data only defines one level per bar, "stacked" should be removed. This d...

3 years ago | 0

Answered
AppDesigner / GUIDE: generate unknown number of new GUI elements as a function
Your quesiton specifies AppDesigner and GUIDE but don't use GUIDE since it will be removed in a future release. Yes, you can pr...

3 years ago | 1

| accepted

Answered
Sorting of column 'folder' present in 'struct'
Sounds like you want natural order sorting. There are some File Exchange submissions that do this (example). But if the forma...

3 years ago | 0

| accepted

Load more