Answered
lsqcurvefit for several data sets at once
Continuing from the comment section under the question, to combine data sets (x1, x2....) and (y1, y2, ...) just combine them i...

7 years ago | 1

| accepted

Answered
making a graph of using date as x axis.
It's unclear what is stored in C{1,1} so I've provided a few options. If class(C{1,1}) == 'cell' %% If class(C{1,1}) == 'cel...

7 years ago | 0

| accepted

Answered
Use of 'regexp' (or equivalent) as conditional statement
Here are the regular expressions that match your description. I'm using regexpi() which is not case sensitive. If you want cas...

7 years ago | 0

| accepted

Answered
Converting Anonymous Function to a Symbolic Function
Is this what you're looking for? v = @(t) exp(1).^(sin(t)) - 1; sym(v) %ans = %(3060513257434037/1125899906842624)^sin(t)...

7 years ago | 5

| accepted

Answered
Help with for loops
Here are three options in order of best-practice. They all produce the same plot. Feel free to ask any follow-up questions. ...

7 years ago | 1

| accepted

Answered
Creating a file upload option/button in App designer
Create the button in your GUI (drag and drop the button onto the designer workspace) Right click the button, hover over 'callba...

7 years ago | 2

| accepted

Answered
why the coordinates start from 800. want it to start from 0 . and the origin point in the left down like usual.
The funtion imshow() flips the y axis. To make the y-axis normal again. ax = gca; ax.YDir = 'normal'; However, your image ...

7 years ago | 0

| accepted

Answered
how to insert rand noise for this?
You can use rand() to produce a vector (or matrix/array) of random values between 0:1. I subtracted 0.5 from those random numbe...

7 years ago | 0

| accepted

Answered
Complete self-avoiding random walk
The code you provided above (also see this source) will need to be slightly adapted to keep track of previous coordinates instea...

7 years ago | 2

| accepted

Answered
How to neglect small digits in all calculations
"Actually, I wouldn't mind precision, however somtimes I find results like 1,0000000001 and this cause complex numbers in trigo...

7 years ago | 0

Answered
Create a sphere using surface equation
"I don't want to use the sphere function because I intend to create multiple spheres and get the x,y,z values to each one of the...

7 years ago | 2

| accepted

Answered
isolating values in a table based on user input
This solution creates a set of logical vectors that identify rows of dpt table that are satisfied by the user input. It then co...

7 years ago | 0

| accepted

Answered
How do I plot my array on Imagesc?
The examples in Matlab's documentation should be useful to follow. https://www.mathworks.com/help/matlab/ref/imagesc.html For...

7 years ago | 0

Answered
Problem with symsum function: doesn't work with matrix elements?
The first two inputs to symsum() should be symbolic. It's difficult to interpret what the code is supposed to do without knowi...

7 years ago | 0

Answered
calendar dates in x axis
You need to specify the x coordinates. In this example, I create x coordinates that start 'today', have an interval of roughly ...

7 years ago | 0

| accepted

Answered
Using a loop to group data and find a Frequency
Use splitapply() No loop needed (preferred method). % Create fake data: Column 1 are years, column 2 are number of earthquake...

7 years ago | 0

Answered
How to use the fields in the structure?
I've responded to your quesitons below. First I make some fake data to work with. % Fake data S.f1 = rand(1059, 3); S.f2 = ...

7 years ago | 1

| accepted

Answered
How can I check if a specific set of numbers are present in my array?
In this solution, the vector C is differentiated and then we find the starting point of each consecutive segment of 1s using bwl...

7 years ago | 1

| accepted

Answered
Animation delete previous point
If your task is that simple, I prefer updating the XData and YData rather than using the animatedline method. This is faster and...

7 years ago | 1

| accepted

Answered
Loop in vector of cells
Based on several examples provided in comments under the question, it appears that the goal is to remove the first element of ea...

7 years ago | 0

Answered
uigetfile, is there anyway to choose multi suffix?
There are examples in Matlab's documentation. https://www.mathworks.com/help/matlab/ref/uigetfile.html#d120e1280759 [file,path...

7 years ago | 0

| accepted

Answered
How to change name of "Others" category for histogram with 'ShowOthers'
Access the axis handle from the histrogram handle ('hh'), then use strrep() to replace the 'Others' in the XTickLabel with whate...

7 years ago | 0

| accepted

Answered
Help with error please
The following line in your code is what's throwing the error "Inner matrix dimensions must agree." e = y-x*bhat; % Gene...

7 years ago | 0

Answered
How can I store nested for loop values to a cell array?
Here's a general sketch of how to store data in a cell array within two nested for-loops. If there is something more specific yo...

7 years ago | 1

| accepted

Answered
Help setting up a 3d plot to only display last 3 readings of data
Here's two general solutions that read in the data as you're doing the plotting but if possible, read in all of your data, store...

7 years ago | 0

| accepted

Answered
How to plot a specific value in Y-axis?
First, your example references the x-axis; not the y-axis. Here's how to plot a portion of the data along the x axis. The same...

7 years ago | 0

| accepted

Answered
How can I display a value of a vector for a specific value?
p = [5 0 6 7 0]; w = [6 2 5 6 7]; % Show the values in w that correspond to p==0 w(p==0) ans = 2 7

7 years ago | 0

Answered
how to get element from matrix
Here's a summary of the comments under the question so that this question is marked as answered. The variable "T" is a structu...

7 years ago | 0

Answered
How can i solve this error?
The for-loop starts with 1 and upon the first iteration, x(i-1) is the same as x(0) which causes the error 'Array indices must b...

7 years ago | 0

Answered
How to set linear Y-axis with logarithm diagram?
Set the 'YScale' axis property to 'log' x = 1:10; y = x.^2; figure h = plot(x,y) set(gca, 'YScale', 'log')

7 years ago | 0

| accepted

Load more