Answered
load x,y
Try this: x = 1:10; y1=[0.5 1.7 1.75 1.9 2 2.1 2.4 2.6 2.7 2.9 ] y2=[0.7 1.8 1.9 2 2.3 2.5 2.7 2.8 2.9 3] save('XYvectors...

6 years ago | 0

| accepted

Answered
Drawing contour on circle with individual(x,y,z) location spots
Use the contour function. If they are not already gridded (in a regularly-spaced 2D array), use the griddata (or related func...

6 years ago | 0

| accepted

Answered
How do I plot 3 dimensional function?
Code it, and include the contourf function in your code to produce the plot.

6 years ago | 0

Answered
Printing lines of text from cell array?
One approach: D = {[1 2 3],[4 5 6 7 8 9],[10 11 12 13 14 15 16 17 18 19 20]} for k = 1:numel(D) fprintf(1, [repmat('%d...

6 years ago | 0

| accepted

Answered
Signal Analyzer - Unable to view Complex Signal
I am not sure that I understand the problem. The ‘env’ and ‘g’ variables appear in my Workspace (in R2020b). There are sever...

6 years ago | 0

Answered
changing header to csv using writetable
In R2016b, the variable names must be valid MATLAB variable names. (That changed in R2020a, so what you want to do would be per...

6 years ago | 0

| accepted

Answered
Use Delimiter only once in row when reading .txt files
Try this: C = {'$CM_TIME 11:44 AM' '$CM_OPERATOR Microscope Administrator' '$CM_INSTRUMENT Microscope' '$CM_...

6 years ago | 0

| accepted

Answered
How to solve ODE (vector of first order equations)?
The numerical ODE solvers pass a time scalar and a vector to the ODE functions they integrate, in that order, so the function mu...

6 years ago | 0

| accepted

Answered
Bug in patch rendering?
If you do not need the edge lines to be displayed, 'EdgeColor','none' will eliminate all of them in the specific patch call that...

6 years ago | 0

Answered
Plotting a Distribution of Molecules
The erf function is your friend! Specifically: x = linspace(-5, 5); y = gradient(erf(x)) ./ gradient(x); figure plot(x...

6 years ago | 0

Answered
Why my plot doesn't show the line?
If you must use a loop, you need to subscript ‘f1’: f1(i) = 1/(10*i/(c+10)); However a loop is not necessary. Using element-...

6 years ago | 1

| accepted

Answered
Slope of a plotted function in a specified point.
It would be easier to have your data. Try this: xv = linspace(0, 5); ...

6 years ago | 0

Answered
Interpolate, find - excel lookup equivalent
The table appears to work stepwise. The interp1 function can interpolate using several options, here 'previous', 'nearest', and...

6 years ago | 0

| accepted

Answered
Plot is generating a series of vectors instead of a continuous line plot
I have no idea what ‘Df’ and ‘Zf’ are, so I created one of them and simulated the data: Zf = {rand(143,1); rand(380,1); rand(1...

6 years ago | 0

Answered
Finding x value at 10% of max y value, after the max
It would be necessary to have a sample of your data to write specific code, so I will simply describe the procedure. First, u...

6 years ago | 0

Answered
'Matrix dimensions must agree' error
Vectorise all multiplication, division and exponentiation operations, and it works: Re = 190000:10000:290000; Pr = 3.66:0.5:5...

6 years ago | 0

Answered
How to plot x^2 - y^2 = 1?
Try this: syms x y figure fimplicit(x^2 + y^2 -1, [-1 1]) axis('equal') .

6 years ago | 2

| accepted

Answered
Need help in 3d plot
Try this (with your matrix of ‘I’ values): I = randn(24,365); % Create Data (For Lack The...

6 years ago | 0

Answered
Find duplicate values in plot
Use either islocalmax and islocalmin, or findpeaks (on the positive and negative of the dependent variable) to identify the peak...

6 years ago | 0

Answered
Damped function second low
I have no idea what ‘second low’ means or refers to, or what you are doing. If you want the minima of the damped waveform, us...

6 years ago | 0

| accepted

Answered
How to show exact answers when using the "residue(a,b)" command
This is a partial fraction expansion (decomposition), so use the partfrac function (introduced in R2015a): syms s V(s) V = 2...

6 years ago | 2

| accepted

Answered
How to add a 1:1 reference line
I am not certain what you want. Try this: x = rand(1,10); % Create Data y = rand(1,10); ...

6 years ago | 0

| accepted

Answered
looking for regular expression to parse sparse data
This uses one regexp call to parse the data into specific cells that are read with sscanf, and then partitioned into individual ...

6 years ago | 1

| accepted

Answered
Multiplying each value of a vector with the corresponding value in another vector?
Use element-wise multiplication. If all the other vectors are column vectors, the [-1 1] vector must be a row vector: theta =...

6 years ago | 1

| accepted

Answered
Plotting a square pulse periodic function
I am not certain what you are doing, or what you want. There are several ways to create square wave pulse trains. Probably t...

6 years ago | 0

Answered
Outline of shape in matrix using contour?
Try this: figure contourf(shape) set(gca, 'YDir','reverse') axis('equal') That should fiip it right-side-up.

6 years ago | 0

| accepted

Answered
How can i load solar data for forecasting as a raw vector in matlab ?
Try this: T1 = readtable('SoDa_MERRA2_lat24.533_lon79.615_2020-09-01_2020-09-30_1151725210.csv', 'VariableNamingRule','preserv...

6 years ago | 1

| accepted

Answered
How to apply exponential anonymous function to NxN matrices?
The symbolic involvement is not necessary. Try this: a = rand(32,32); b = rand(32,32); Y = @(a,b,t) a.*exp(-t./b); Test ...

6 years ago | 1

| accepted

Answered
Unknown glitch when finding an exact array value
That reflects the way the colon operator works to calculate the vector elements. See the documentation section on Floating-Poin...

6 years ago | 0

| accepted

Answered
How to determine an x value at a specific y value?
Try this: t = [0:1:50]; Y0 = [0.05 5]; % initial values [tout, Yout] = ode15s(@func2,t,Y0); [Smin,Sminidx] = min(Yout(:,...

6 years ago | 0

Load more