Answered
How to perform operations on cell arrays?
My understanding of the problem is that you have a cell array of column vectors and you'd like to differentiate them. I've crea...

7 years ago | 0

| accepted

Answered
Select a point on the graph
To find the coordinate closest to the origin (0,0), d = hypot(member_value(:,1),member_value(:,2)); [~, minIdx] = min(d); ...

7 years ago | 0

| accepted

Answered
Add another label that groups the bars in a bar plot together
Add this to the end of your code. By the way, avoid using cd() by specifying full paths whenever possible. ylim([-40,100]) ...

7 years ago | 1

| accepted

Answered
Turning data in time domain into percentage
I'm guessing your time column represent a portion of the day (ie, hh:mm) and it's that column that you want to turn into a perce...

7 years ago | 1

| accepted

Answered
How to draw a star in matlab
Here's an easy solution but the star size will not scale with axes size if the figure size is changed. fh = figure(); rectangl...

7 years ago | 0

Answered
How to calculate error between two matrices of different dimensions?
Not sure how you're defining error but to get every 100th element of B, B(1:100:end) Perhaps error is just the difference bet...

7 years ago | 1

| accepted

Answered
Could anyone help me how to change the values in array
A=[1 2 3 4 5 6]; B=[1 2]; A = repmat(B,size(A,1),1) or A = B .* ones(size(A))

7 years ago | 0

| accepted

Answered
Create an array referring to another array
Here's a list of some of the changes made to your code. The new version is below and it produces the outputs you described in yo...

7 years ago | 0

| accepted

Answered
Creating a new data table from existing table based on condition.
By 'dataset', do you mean a matlab dataset array or are you using the term more generally, working with tables instead? The dem...

7 years ago | 0

Answered
How to draw a star in matlab
"I need to create a figure of the vietnamese flag" I used this question as an excuse to play around with some of the image proc...

7 years ago | 2

Answered
How to set a range for a random 4x3 Matrix
bounds = [-10,10]; x = rand(4,3) * range(bounds) + bounds(1); % for decimals x = randi(bounds,4,3); % for integers T...

7 years ago | 1

Answered
How to create a GUI
I think drag-n-drop construction of GUIs is a useful tool, especially for beginners, but it comes with limitations and, in the c...

7 years ago | 6

Answered
How to generate number of arrays dynamically?
The n - arrays can be stored as rows of a matrix or as elements of a cell array. They can be allocated as NaN, 0s, 1s, logical...

7 years ago | 0

| accepted

Answered
Adding row 2 and row 3 and multiplying it by 3
A= [ 1 1 1 1 1; 1 1 1 1 1; 1 1 1 1 1; 1 1 1 1 1; 1 1 1 1 1]; A(3,:) = sum(A([2,3],:)) * 3; % ^ No...

7 years ago | 0

Answered
Error using / Matrix dimensions must agree
There's not enough information in your question to know what line is producing the error but I'll go out on a limb and guess tha...

7 years ago | 0

| accepted

Answered
Remove a specific string from a cell matrix
Option 1: strrep() to replace 'Temperature ' with empty C = {'Temperature 10';'Temperature 10';'Temperature 25';'Temperature 30...

7 years ago | 0

| accepted

Answered
Draw points on a image
If you have the image processing toolbox, there are a few tools that do what you're describing. drawpolygon() https://www.math...

7 years ago | 0

| accepted

Answered
Splitting a table into smaller ones based on two columns
That can easily be done in a loop but it doesn't sound like a good idea. Breaking apart well-organized tabular data into sub-ta...

7 years ago | 1

| accepted

Answered
for loop that changes specific letters to numbers
No loop needed. str = 'apple'; isConsonant = ~ismember(lower(str),'aeiou') %lower() makes it not case sensitive If you real...

7 years ago | 2

Answered
Move on to next iteration when condition is satisfied, specifically when using functions
It's better to use elseif in the form below. A 'return' will stop execution of the function and return execution to the caller....

7 years ago | 0

Answered
Align position of multiple UIAxes objects
Open the app in apdesigner. Select all components that you'd like to align by holding down the ctrl button while you selected t...

7 years ago | 0

| accepted

Answered
How to remove UI windows after a bug
I think it's a bad idea to automatically close the figure whenever there's an error since the figure may contain information tha...

7 years ago | 1

| accepted

Answered
How to plot square diagram
Use heamap(). Demo: data = diag(randi(20,1,20)+40); heatmap(data) xlabel('predicted') ylabel('actual') %Create colormap ...

7 years ago | 0

| accepted

Answered
If the values are almost equal to each other,how do i plot the figure to see its curve? (not straight line )
Depending on the range of your data, it may be difficult to see the differences when, in fact, the differences are miniscule. ...

7 years ago | 0

Answered
Display values as labels at the tips of serie of bars.
You've got your x's and y's mixed up. xtips1 = b(1).YEndPoints + 0.3; % ^ should be XEndpoints ytips1 = b(1).XEn...

7 years ago | 0

Answered
years read in as 18 instead of 2018; how do I add 2000 years?
Read the data in as text rather than datetime by using the DateTimeType parameter of readtable(). Then specify the datetime fo...

7 years ago | 0

| accepted

Answered
Undefined function or variable error
'simu' and other variables are only defined when nanmean(zb_post(i,j)) == 1. If that nanmean() is not equal to exactly 1, 'simu...

7 years ago | 0

| accepted

Answered
can i have a box with 3 buttons?
"Is there a way to add additional button to Inputdlg?" No. One alternative is to build your own input dlg using uicontrol() b...

7 years ago | 1

| accepted

Answered
Question about two Checkboxes being checked and increment a number
ml = get(handles.checkbox_trial,'Value'); ml1 = get(handles.checkbox1,'Value'); ml2 = get(handles.checkbox2,'Value'); if ml =...

7 years ago | 1

| accepted

Answered
Make UIAxes invisible/visible when stacked in App desginer..
Update: Starting in Matlab r2020b, change the stack order of UI components in App Designer using the reorder tool (see release n...

7 years ago | 0

| accepted

Load more