Answered
Can't get graph to appear
Here's what I think is happening. Remove clf at line 1 of your code. You can't put that before the function definition. cl...

7 years ago | 0

| accepted

Answered
How to plot a one year rainfall data
I read in the data using readtable() but you can use any method as long as your data are organized into an [m x n] array with m ...

7 years ago | 0

| accepted

Answered
Create header for merged table columns
This should get you started (r2018a or later) https://www.mathworks.com/help/matlab/ref/table.splitvars.html You're basicall...

7 years ago | 0

| accepted

Answered
Fill an array with a vector using a for loop
Since this sounds like homework, I'll get you started and you can fill in the blanks. m = zeros(__,__); v = rand(1,52); ...

7 years ago | 0

| accepted

Answered
How to remove rows that contains other than decimal value in a column?
Replace rows of table1 that contain a number in string format in column 3 with empties: isStr = isnan(str2double(table1(:,3)));...

7 years ago | 0

| accepted

Answered
MATLAB function help, input arguments errror
After saving your function, add it's path to matlab. Suppose you saved your function in C:\Users\name\Documents\MATLAB\ ad...

7 years ago | 0

| accepted

Answered
'Not Enough Input Arguments" error in IF statement
You're probably running the function without an input. You must include an input. Big(77); %this doesn't produce an error ...

7 years ago | 0

| accepted

Answered
NaN with backslash operator
The following rows of your variable "B" contain NaN values. find(isnan(B)) ans = 1491 1492 1493 ...

7 years ago | 1

| accepted

Answered
Adding column headers to writetable csv file
The default value for the WriteVariableNames parameter in writetable() is true so all you need is to add variable names to your ...

7 years ago | 2

| accepted

Answered
Trying to plot a scatterplot AND Histogram within a loop?
This will get you started on the figures and you can adapt it to your needs. I haven't assessed whether the simulation is what ...

7 years ago | 1

| accepted

Answered
Why do I get different distribution parameters each run?
The default initial value starting method in fitgmdist() uses a k-means alogorithm that is not deterministic; it uses probabili...

7 years ago | 0

| accepted

Answered
I am struggling to use sprint
strjoin() f=["apple," "pear," "banana," "orange"]; A=sprintf('The fruits are %s and they are tasty.\n',strjoin(f));

7 years ago | 0

| accepted

Answered
Why do I keep on getting "Not Enough Inputs" for an If statement in a function
'Big' is a function. When you call this line sum = (Big - Small); you're calling your function Big() without any inputs. ...

7 years ago | 0

| accepted

Answered
How do I change the colours of the bars in a bar plot?
Use the handles to your bar chart to change the colors. bh = bar(LOI); bh(1).FaceColor = [0 0 1]; %blue bh(2).FaceColor = ...

7 years ago | 2

| accepted

Answered
How can I display a matrix as a figure?
"Somebody says you can use same command such as uitable or imagesc but I can't." This should get you started. imagesc() More...

7 years ago | 4

| accepted

Answered
How do I create a legend involving multiple plots created in a for loop?
Here are some demos you can follow. Option 1: add legend labels when you call legend figure() axes hold on nLoops = 3; p...

7 years ago | 2

Answered
How can I avoid the "change folder / add to path" window when running a script?
Paul, start a startup.m file and store it in your main matlab folder. From the documentation, "At startup, MATLAB automatical...

7 years ago | 0

Answered
Generate unevenly-spaced synthetic time series
If your samples are not integers You can set the maximum sample, the [min, max] of your bounds, and the starting number. tsyn ...

7 years ago | 0

Answered
How can I add a title using slice plots?
Here's a functional demo of Adam's and Kalyan's suggestions. I added a different method of getting the axis handle. % Create...

7 years ago | 0

| accepted

Answered
Creating daily average of data set from half hourly data
Option 1 The cleanest solution (IMHO) is to convert your data to a timetable and use retime() to calculate the daily average. ...

7 years ago | 0

| accepted

Answered
How to read a txt and create a vector and a matrix
Text file attached that matches your description. m and v are your matrix and vector. text = fileread('data.txt'); textRows...

7 years ago | 1

| accepted

Answered
I'm getting the error "terminate statement with semicolon to suppress output" but I haven't used any functions.
Your sample code does not provide a value for x. When x is a vector (x = 0 : .01 : 5), your plot produce lines. As for the se...

7 years ago | 0

Answered
Determine which cells contain elements of another cell
Here's a simpler solution than my first proposal. fileNames = [{'.'}, {'..'}, {'1.bin'}, {'1_Report.txt'}, {'2.bin'}, {'2_Repo...

7 years ago | 0

| accepted

Answered
How can I get the plot for a saved figure?
"If there was a command 'gfc' (get current figure) but for the data itself it would be of great help to me." Open the .fig file...

7 years ago | 2

Answered
Determine which cells contain elements of another cell
fileNames = [{'.'}, {'..'}, {'1.bin'}, {'1_Report.txt'}, {'2.bin'}, {'2_Report.txt'}, {'3.bin'}, {'3_Report.txt'}, {'4.bin'}]; ...

7 years ago | 0

Answered
Is the $150 home option annual or perpetual?
When is the right time to buy a Home license to access the latest release? A Home license can be bought at any time to access t...

7 years ago | 0

| accepted

Answered
Can someone show me how to put the labels inside the colorbar?
Since you can't add text objects to the colobar, you can add an invisible axis on top of the colorbar and place the ticks there....

7 years ago | 0

| accepted

Answered
Is there a way to record the usage of functions in a matlab program?
Here's a way to store the timestamp and user name to a mat file every time a function is called. The username is pulled from th...

7 years ago | 1

| accepted

Answered
Coloring The Dots in biPlot Chart
The biplot() function has an output that lists handles to all objects in the plot. All you need to do is isolate the handles to...

7 years ago | 0

| accepted

Answered
Undefined function or variable using readtable and IF
As the error message indicates, there is no variable (or function) named 'Lane1' which means "Lanes" does not equal 2,3,4,5, or ...

7 years ago | 0

Load more