Answered
How can I synchronize the y axis range and zoom of multiple graphs created with "subplot" ?
https://www.mathworks.com/matlabcentral/answers/341987-how-can-i-make-that-the-axes-change-at-the-same-time-in-two-subplots-when...

7 years ago | 0

| accepted

Answered
How to collect it by using loop
Don't name the variable dynamically use cell instead R=cell(1,14); % preallocation for i=1:14 R{i}=find(image); end celldi...

7 years ago | 0

| accepted

Answered
I am trying to get this function to work properly. I am wanting it to add together given values. What is wrong with my syntax? Thank you.
function result = findSum % no need for input because they are defined inside the function a=3; % have to be defined before u...

7 years ago | 0

| accepted

Answered
Creating a function with endless errors
Don't use global variables it's a bad practise , learn to parameterize functions. See Parameterize function to better understan...

7 years ago | 0

Answered
Why do I receive License Manager Error -9?
https://www.mathworks.com/matlabcentral/answers/121193-how-to-calculate-a-max-value-in-a-array-without-the-built-in-functions#an...

7 years ago | 0

| accepted

Answered
How can I adapt a summation function (see below) with a for loop to create a "x to the power of n" function without using the "^" operator?
I mean is the loop necessary? n=4; cumsum(repmat(2,1,n)) % 2 is x here if you still insist: answer = sum1(x,n) %function c...

7 years ago | 0

| accepted

Answered
what axis will do ??
Read axis() the axis specifies the limits for the current axes. just try the below example axis(1,10,2,11) % x axis goes fro...

7 years ago | 0

Answered
how to plot z=9-sqrt(x^2+y^2) inside the cylinder r=2?
syms x y ezsurf(9-sqrt(x.^2+y.^2)); axis([-10 10 -10 10 -10 10]) % you can limit the range here hold on fimplicit3(x^2+y^2...

7 years ago | 0

Answered
I would like to understand how to solve this equation with the unknown "a". I admit I'm not an expert with the solve function. I followed the online directions but I continue to receive this error, Someone can help me? Thank you!
syms a j mu D R_earth k pi J_2 eqn= j*abs(-2*pi*(2*pi*(a^3/mu)^1/2)/D-(3*pi*J_2*R_earth^2*cos(i))/(a^2*(1-exp(2))^2))==k*2*pi...

7 years ago | 0

Answered
When to use .^ notation?
when you have a vector the right usage is .^ which is element wise operation each element is raised to the power ^ is only for s...

7 years ago | 1

| accepted

Answered
How to use an object property in a rogue function?
r1.rx=matlabFunction(1/(k1*(1-x))) %change this line and remove @(x) from the next line

7 years ago | 1

| accepted

Answered
why is my function not working?
change 'ppl' to @ppl

7 years ago | 1

Answered
Generating random 20 number between 0.25 to 2.8 and counter odd numbers in 'array'?
a = .25; b = 2.8; r = (b-a).*rand(1,20) + a; % note that your creating floating numbers

7 years ago | 0

| accepted

Answered
Using the cubic spline code below, I need to extract the value found for x = 3.5. How do I call this value?
x0=3.5; %an example y is the value that you want to get when x=3.5 y0=interp1(x,y,x0) % will give you the corresponding value ...

7 years ago | 0

Answered
How to download Matlab 2015a
https://www.mathworks.com/downloads/web_downloads/get_release?release=R2015a

7 years ago | 1

| accepted

Answered
Undefined function or variable error
'Y' not Y

7 years ago | 0

Answered
Undefined function 'offsetstrel' for input arguments of type 'char'.
Didn't get any errors? maybe try clear all and try again >> se = offsetstrel('ball',11,90); >> se se = offsetstrel is ...

7 years ago | 0

Answered
DAE Solver for Height vs Time plot with variable
Just parametrize your ode function like I showed in your previous answer?

7 years ago | 1

| accepted

Answered
How do I divide one table by another?
% where T and T1 are tables T.distance ./ T1.Time % just an example where T containing column distance is divided by time in ...

7 years ago | 2

| accepted

Answered
why does this code return that my variable A is undefined when i run it? how can i change this?
because you didn't define A A=somevalue if X==A

7 years ago | 1

| accepted

Answered
Can I run a function in for loop
Just call the function inside the loop meaning remove the word function in the above photo you attached.

7 years ago | 0

Answered
what does this code do......help
https://www.mathworks.com/help/matlab/ref/imread.html

7 years ago | 0

Answered
Sum of specific elements in a column matrix
a=[1;2;3;4;5;6;7;8;9]; sum(a(3:size(a,1))) % size(a,1) can be whichever element you wish command window: ans = 42

7 years ago | 0

| accepted

Answered
I have to calculate integration to get value of T but it giving error during solving with syms and integral options both
EDITED Read about matlabFunction() the below works: clear all clc l=0.912; b=0.224; h=0.220; syms u g=9.81; ...

7 years ago | 0

Answered
I want to calculate factorial of a large data set containing some NaN in between the data.
a=[7 8 95 210 85 NaN NaN 52 NaN] factorial(a(~isnan(a))) % why not this?

7 years ago | 0

Answered
How to count the number of filled elements in a structure field?
sum(arrayfun(@(x) ~isempty(x.p),x)) command window: ans = 2

7 years ago | 1

| accepted

Answered
I am trying to write a MATLAB code. The MATLAB results a warning "Warning: Explicit integral could not be found" and does not solve. Why?
Read about matlabFunction() and integral() to solve your integral numerically since the symbolic engine is not able to solve it ...

7 years ago | 1

| accepted

Answered
How do I save a matrix output from a single iteration of a loop?
x={[1:5]; %an example [linspace(0,1,5)]}; y=cell(1,size(x,1)); %pre-allocation for i = 1:size(x,1) y{i}=[x...

7 years ago | 0

| accepted

Answered
Excel file import Infinite value numbers
Try using readtable() to read the file

7 years ago | 0

Load more