Answered
Plot text with numbers
Try this: T1 = readtable('test.xlsx'); vars = T1.Properties.VariableNames; figure plot(T1{:,2}) Ax = gca; Ax.XTick = 1:...

6 years ago | 0

| accepted

Answered
How to insert tab \t in text?
The text-based functions (including legend, title, xlabel, ylabel, and zlabel) do not recognise ‘\t’. Insert spaces manually in...

6 years ago | 0

Answered
I want to solve an equation for I where I have V values. But I am getting error on using fsolve. Failure in initial objective function evaluation.
Vectorise every sub-expression involving ‘I’, then it works: eqn=@(I) -I+Ioidr.*(exp((V-I.*(rp+rn))/phit)-1)+(q*area*(sqrt(2*e...

6 years ago | 1

| accepted

Answered
How to run a for loop when variables are different lengths?
The easiest way is to make one into a column vector and keep one as a row vector. This creates a matrix for ‘beta’: delta = -...

6 years ago | 0

| accepted

Answered
draw angle between two vectors
Try this: figure hp{1} = polarplot([45 160; 0 0]*pi/180, [1 1; 0 0], '--k', 'DisplayName','Induction'); hold on hp{2} = pol...

6 years ago | 1

| accepted

Answered
Display a shifted grid
I am not certain what you want. Try this: x = 1:0.1:10; % Create Data y = rand(size(x)); ...

6 years ago | 0

| accepted

Answered
Remove noise parts in the signal
The problem is that your signal displays broadband noise (readily apparent in the Fourier transform plot), and no freuqency-sele...

6 years ago | 1

| accepted

Answered
Sine wave change zero crossing and increase amplification
First, use the fft function to do a Fourier transform to see what the signal frequency components are. After that, it should ...

6 years ago | 0

| accepted

Answered
Help plotting a signal pulse
I always define functions similar to ‘unitstep’ as a function: unitstep = @(t) t >= 0; This makes it easier to work with. (T...

6 years ago | 0

| accepted

Answered
Problem when plotting the figure
I do not have ‘k’, so I created my own, and was able to reproduce essentially the result you got. The multiple lines disappea...

6 years ago | 0

| accepted

Answered
Exclude NaN cells from a cell array
Try this: fine_xx = {rand(10,1);rand(10,1);[];rand(10,1);[];[];rand(10,1)} fine_xx = fine_xx(cellfun(@(x)~isempty(x), fine_xx...

6 years ago | 0

| accepted

Answered
How to use loop to use a range of values
You could use nested loops, one for ‘x0‘ and another one for ‘v0’, or you coud do it the easy way, using vectorized code for ‘A’...

6 years ago | 1

| accepted

Answered
Why do I receive legend error in matlab
I cannot run yuour code, since I get: Unrecognized function or variable 'second_order1'. What is the error you are seeing? ...

6 years ago | 0

Answered
the program shuts down when i use
If you are using Windows, see: Why will MATLAB not start up properly on my Windows based system? That worked for me when I had ...

6 years ago | 0

Answered
MATLAB warning with Trapz
The dim (dimension) argument is the last argumen to trapz. See Integrate Matrix with Nonuniform Spacing for an illustration. ...

6 years ago | 0

Answered
How to fit polyfit coefficients to a linear model
Try this: x = 1950:2020; % Create Data y = 0.07*x.^2 -300*x + 304130 + randn...

6 years ago | 0

| accepted

Answered
Change grid extent so title is visible
One option is to change the Position prop[erty of the axes: Ax = gca; AxP = Ax.Position; Ax.Position = AxP+[0 0 0 -0.05]; S...

6 years ago | 0

Answered
unable to plot graphs
Try this: format long; syms cp positive ctv=0:0.05:1; for k = 1:numel(ctv) ct = ctv(k); eqn = (1.38/(cp/ct)^2)-0...

6 years ago | 0

| accepted

Answered
How to draw specific 3D shapes in MATLAB?
I am not certain that this is a significant improvement, however I offer it as an alternative: boxx = [1 2 2 1 1]; boxy = [1 ...

6 years ago | 0

Answered
R2020a Update 4 does not work
Do not use Add-Ons. In R2020a, use: Help —> Check for Updates

6 years ago | 0

Answered
How can I grab the value of i for which out(i) is equal to s(2)?
What you want to do is not obvious. If you want to know the index of the second value of ‘s’ (the second lowest value of ‘out...

6 years ago | 1

| accepted

Answered
How to plot a two variable function with exponentials and cosine.
I am not certain what you want. Try tthis: x = linspace(-pi, pi, 60); % Use Your Own L...

6 years ago | 0

| accepted

Answered
Error with delta function Matlab 2019
I have no idea what you actually want to do. It is generally appropriate to use filtfilt rather than filter for signal proces...

6 years ago | 0

| accepted

Answered
Is there an online remote server that I can run my code on?
Not directly related to MATLAB Online, however you might be interested in How to save data from Genetic Algorithm in case MATLAB...

6 years ago | 0

Answered
Array indices must be positive integers or logical values.
Add some multiplication and element-wise operators: payment=loan*((rm*(1+rm).^n)./(((1+rm).^n)-1)); ↑ ↑...

6 years ago | 1

| accepted

Answered
Plotting four plots when only two plot
Add figure calls to create new figure windows, otherwise the plots will occur on existing figure windows, and over-write the pre...

6 years ago | 0

| accepted

Answered
Slope of the linear(elastic) part of a stress-strain curve
See: How do I determine the linear part of a force-displacement curve?

6 years ago | 0

| accepted

Answered
Unitstep Function (Heaviside Function) Plotting Help
There appears to be missing information, specifically because in the top plot it is not rising at , it is instead rising at . ...

6 years ago | 1

| accepted

Answered
Output argument ‹variable› (and maybe others) not assigned during call to ‹function›
I cannot run your code because I have no idea what the arguments should be. I guessed at the arguments, and when I ran your fun...

6 years ago | 0

Answered
Plotting with a step
See the documentation for colon,:.

6 years ago | 0

Load more