Answered
To generate matrix from an array
Use implicit expansion. (starting r2016b) B = A(1:end-2) + (0:2); %assuming A is a column vector C = A(1:end-3) + (0:3); %a...

7 years ago | 0

| accepted

Answered
How can I define the colors of the bar, depending on their Z value?
After the section of code in your comment above, you can change the colormap to one of Matlab's built-in colormaps or you can cr...

7 years ago | 0

| accepted

Answered
How to resize a group of ones in an array of zeros?
Maybe interp2() would help. % Input data m = [0 0 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0]; % Inte...

7 years ago | 0

Answered
How to draw random number from a conditional distribution
The first condition is easy, X = randn(1,100000) * .63 + 12.21; figure histogram(X) mean(X) % <--- ~12.21 std(X) % <---...

7 years ago | 0

| accepted

Answered
grouped stacked bar with specific colours
Within the plotBarStackGroups() function, bar handles are stored in 'h'. Add that as an output to the function so you have acces...

7 years ago | 3

Answered
Heatmap Chart - Depict Squares rather than Rectangles
It drives me nutz that heatmap properties are special cases. To set the aspect ratio of the heatmap, you need to adjust the axis...

7 years ago | 4

| accepted

Answered
Having trouble using cell2mat
You were on the right track. You're reading the data as cell array of strings so you need to convert the data to numeric using ...

7 years ago | 0

Answered
How to compare a coefficient from two regression
One way would be to compute the 95% confidence interval of the regression coefficients and determine whether they overlap (which...

7 years ago | 0

Answered
unexpected string scalar error?
There are 2 required inputs and 1 optional input to taylor() followed by optional name-value pair arguments. Your call to taylo...

7 years ago | 0

Answered
Manova(rm)
Matlab's documentation is really thin when it comes to many of their statistical methods which makes it difficult to address som...

7 years ago | 0

Answered
how to fit different lines for scatter points from specific categorical data?
Easiest way is to do it in a loop. placeUnq = unique(place); %all unique place values fit_line_groups = cell(numel(placeUnq),...

7 years ago | 1

| accepted

Answered
Error with xlswrite (error 0x800A03EC)
This is an excel error code - not a problem with matlab. If you search for that error code you may find some help. For example...

7 years ago | 0

Answered
several Boxplots in one window of multiple vectors with various length
Unfortunately it's difficult to specify the position of a boxplot along the x axis so when plotting boxplots within a loop, the ...

7 years ago | 0

Answered
how to solve Index exceeds the number of array elements (1).
'f' has a single value (0). In the for-loop you attempt the get the 2nd value here: % i = 3 ff=1.5*f(i-1)-0.5*f(i-2); % ...

7 years ago | 0

Answered
Ways to shade points-delimited area or smooth the edge
You could create a matrix of y-values where each column corresponds to an x-coordinate (so, plotting column 'n' would results in...

7 years ago | 1

| accepted

Answered
How to change a certain array cell depending on its length
If 'A' is a cell array of character vectors and you'd like to replace cells that have a length greater than 250 with an empty ch...

7 years ago | 2

| accepted

Answered
How to generate random matrix from another one?
You can use randperm() to shuffle the values of array 'm'. % Original array m =rand(180, 57, 11); % Random permutation ind...

7 years ago | 0

| accepted

Answered
Error in plot function
Remove the 'LineWidth' name-value pair and specify it after plotting. p1=plot(f1,WindowSizes,Data1Disjoint); set(p1,'LineWidt...

7 years ago | 0

| accepted

Answered
Try to mix as much as possible elements inside an array
The 'exchangeOpts' is a list of exchange options such that any value in V that matches a value in exchangeOpts{n} can be replace...

7 years ago | 1

| accepted

Answered
How to make trasparent the background of the static text.
When you set the BackgroundColor of a static text box to "none", a black patch appears rather than transparency. As a workarou...

7 years ago | 0

| accepted

Answered
I am getting a blank graph when I try to plot a while loop. I am not sure why. My code is below. Thank you MATLAB
On each iteration of your while-loop CR and HF produce 1 coordinate but you're asking to draw a line which requres 2 coordinates...

7 years ago | 1

| accepted

Answered
Converting time data to plot
After you convert to datetime, keep it in datetime format. There's no need to convert it to char. From r2016b onward, you ca...

7 years ago | 1

Answered
Low Pass filter for big experimental data set
My hunch is that x1 should be a vector (not a matrix) and that Fx is a column vector. If this hunch is correct, the solution ...

7 years ago | 0

| accepted

Answered
Put workspace data into menu and prompt someone to select it
You weren't saving the user's selections (menu outputs). The output to menu is an index of the user's selection. Use those ind...

7 years ago | 0

| accepted

Answered
Placing annotations at specific xy coordinates
Annotation objects are designed to annotation the figure space in figure coordinates. They are not designed to be positioned wi...

7 years ago | 0

| accepted

Answered
Return data from GUIDE on figure close
To delay a GUIDE-GUI output until the GUI is closed, follow these steps. A functional demo is attached that produces an empty G...

7 years ago | 2

| accepted

Answered
Carrying over variables in app-designer
Avoid using global variables. Instead, you can define a new property of your app that stores the fileLoc data. The process is...

7 years ago | 5

| accepted

Answered
How to ask the user how many file extensions to search for
That's too much work (for you and the user). Instead, the user could just list all file extensions in the first dialog, separat...

7 years ago | 1

| accepted

Answered
Copying a matlab gui to a different directory
This is among the common problems with GUIs produced in GUIDE. Many volunteers in this forum are not shy about their disdain fo...

7 years ago | 0

Answered
Is it possible to draw a bar plot with percentage lines?
Use cumsum() to compute the cumulative sum of each bar height. Then you can normalize it to the max bar height (this is how I i...

7 years ago | 1

Load more