Answered
Does anyone know what these lines of code are doing? Thanks
"Does anyone know what these lines of code are doing? " The short answer: no. No, because we can't be sure what RandChooseN()...

8 years ago | 2

Answered
Add row and column headers to 3d matrix
This example creates row and column headers and puts your data and the headers into a cell array. % Create fake data Z = rand(...

8 years ago | 1

| accepted

Answered
Would like to add standard error bars to bar graph
You aren't plotting the error bars. Use the errorbar function errorbar(M, err) However, you'll need to specify the x value...

8 years ago | 1

| accepted

Answered
How to add columns to form a matrix?
Create the matrix (or vector) from within the for-loop, not afterwards. dcmatrix = nan(N, 1); %allocate the matrix (I don't ...

8 years ago | 1

| accepted

Answered
How to get value of uicontrol object whose callback is executing?
"In order to make this work, I am using the value of each of the buttons to determine how to handle the data being given." Idea...

8 years ago | 2

Answered
How to pass message box value to the text box?
If I understand you correctly, you want to extract the text from a message box and copy it to a text box in your GUI. Step 1:...

8 years ago | 0

| accepted

Answered
How do I add a list to an element of a 3D cell array?
In this solution, your original cell array is named 'a' and the list of elemets to add to 'a' are stored in cell array 'b' which...

8 years ago | 0

Answered
How do I load 50 numbers from a text file that contains 100 numbers to matlab
It depends on how your data are stored in the text file. Here are some methods of reading numerical data from a text file. ht...

8 years ago | 0

Answered
How to save multiple figures into a folder on desktop from a for loop?
Here's a function that saves all available figures to a specified destination and you can also specify the file extension (fig, ...

8 years ago | 0

| accepted

Answered
color of line plot with marker problem
The color of the line is controlled by the 'color' parameter. x = linspace(0,10,50); y = sin(x); plot(x,y,'-s','MarkerSize...

8 years ago | 0

| accepted

Answered
Projecting a point into a line
You need the equation of both perpendicular lines. You already have the equation for the first line. In your line y = 5.6x - ...

8 years ago | 1

| accepted

Answered
Creating a row vector of values from for loop
There are a few problems. 1) You should allocate Displacement prior to the i-loop just like you did for variable "A". Displ...

8 years ago | 0

Answered
How to grab Numbers within a string
There are two different outputs. The first preserves the leading 0s by keeping the numbers in string format. The second puts t...

8 years ago | 1

| accepted

Answered
Delete the string symbols on specific line with special symbol.
Here we use fileread() to read your txt file into matlab and then we put each line of text into a cell array. Using regexp() we...

8 years ago | 0

| accepted

Answered
Create a binary array with any dimension
Use fwrite() https://www.mathworks.com/help/matlab/ref/fwrite.html

8 years ago | 0

| accepted

Answered
how to fix the gap?
A line will be drawn for each column of Tx, Ty and Tz. If you remove the 'b' color definition from your call to plot3(), each l...

8 years ago | 0

| accepted

Answered
what is the meaning of the data in aoctool output tables?
There are entire semester-long courses on understanding analysis of variance. All decent statistical software produces a table ...

8 years ago | 2

| accepted

Answered
Adding different colors to the same plotting line
The variables idx1, idx2, idx3 replace your for-loop and mark the indices of x and y that are categorized by your logical expres...

8 years ago | 0

| accepted

Answered
repeated measures ANOVA with MATLAB
There are 3 parts to the question. Is repeated measures ANOVA appropriate for these questions? Yes. The null hypothesis for a...

8 years ago | 3

Answered
Draw line on image with known slope
If you have the staring point (A,B), the slope (m) the y-intercept (yint), and the axis limits XL, YL (where XL and YL are (min,...

8 years ago | 1

| accepted

Answered
How to read audio files from many directories ?
The dir() function will come in handy for all of this. The first step is to read the documentation in the link and understand t...

8 years ago | 1

| accepted

Answered
matlab sounds in game design
(continued here from comments above) If you're using matlab verstion 2012b or later, you should be using audioread() (link) rat...

8 years ago | 2

| accepted

Answered
Put Strings in a column
First convert to a cell array (you must use curly brackets). That will result in a single column. Then use reshape() and trans...

8 years ago | 1

Answered
How to format a text box annotation?
You need the handle to the annotation object. Once you have the handle, you can see the list of editable properties. ah = a...

8 years ago | 0

| accepted

Answered
How to draw lines in between points that the user provides?
"The x = ... and y = ... is clearly wrong as it makes a seperate figure with lines and the lines are not on the picture. " You ...

8 years ago | 0

| accepted

Answered
4 tap moving averaging filter
Moving averages in matlab can be done using movemean() or with filter()

8 years ago | 0

Answered
Add 2 to the element in the 2nd row and 3rd column of given matrix.
A(2,3) gives you the element in the 2nd row, 3rd column. To manipulate that value while leaving the other values of A the same,...

8 years ago | 0

| accepted

Answered
MATLAB GUI not showing errors but not displaying results when pushbutton is clicked
My guess is that one of your variables (Q, L V, ...) is empty. When you pass an empty through str2num() it produces an empty ve...

8 years ago | 0

Answered
Can I have two different y axis for the same dataset?
yyaxis https://www.mathworks.com/help/matlab/ref/yyaxis.html

8 years ago | 0

Answered
how to get all the data points from a 10x10 figure?
[Edit]: You likely already have the points since you just plotted them (as Image Analyst pointed out). However, if you just hav...

8 years ago | 1

| accepted

Load more