Answered
"Error using bitxor Double inputs must have integer values in the range of ASSUMEDTYPE.
The error probably pops up because of the fact that the maximum value in either _RR_da_ or _sy_ is greater than *2^(64)-1* or th...

8 years ago | 0

| accepted

Answered
how to make a 3x3 matrix a 9x1 matrix?
reshape(x,9,1) or x(:) % this creates a column vector out of a matrix

8 years ago | 0

| accepted

Answered
i want to plot transfer function G ,how to do it???G=(((0.2274.*(4.7372.*(s).^(1+0.9)+1)))./((9.9944.*(s).^(1+0.9)))+0.3610.*(s).^(0.9)+1))));
Use *fomcon* toolbox to do it. It has several features: <https://www.mathworks.com/matlabcentral/fileexchange/66323-fomcon-to...

8 years ago | 0

| accepted

Answered
Specify any block parameter values from other constant block (simulink)
The easiest overcome to this problem is using *Masking* in Simulink. Take all RLC blocks within the same subsystem and right cli...

8 years ago | 0

Answered
I am creating for loop for my data. Please help to export my data into a single sheet.
for m=1:365 x(:,:,m) =a(n+2:n+5,2:11) avamean(:,:,m)=mean(mean(x(:,:,m))) n=n+7; end

8 years ago | 0

Answered
How do I change the following time-steps in my code with it still working? When i change the following code to N=20, L = 50 etc the code breaks down. IS there a way around this?
Replace surf(tt,yy,A_mat)%for coloured 3D plot with surf(tt.',yy.',A_mat)%for coloured 3D plot Make sure that _tt...

8 years ago | 0

Answered
if within while loop not recognized
A trivial answer: Use *ismembertol* for comparing values with tolerance tol=1e-6; if ismembertol(t,0.05,tol)

8 years ago | 0

| accepted

Answered
MATLAB simulink, can you help me?
I made a simple model but you need to modify it since I did not fully understand what you want to do. I gave random values for a...

8 years ago | 0

| accepted

Answered
How to replace missing data with a random value in the statistical distribution
x(isnan(x))=randsample(x(~isnan(x)),1)

8 years ago | 0

| accepted

Answered
How to plot function within a set of axis?
It is because the output of the function is scalar. Try using a specified *marker* inside _plot_: theta=pi/6; plot(theta...

8 years ago | 0

| accepted

Answered
hello , i want to remove the repeated values in vector without using Unique function
A = [1 1 2 2 3 3 1] [val,idx]=sort(A) idx=A(idx(1:end-1))==A(idx(2:end)) val(idx)=[] % take it as new A vector

8 years ago | 0

Answered
plotting the function 0.0174*(Y-2)*sin((pi*(X+0.1)/(14.34-0.3*(Y-2))-0.00092.*(X-3)*(Y-2) in 3D
Something like this? [X,Y]=meshgrid(0:0.01:10,0:0.01:10); Z=0.0174.*(Y-2).*sin((pi*(X+0.1)./(14.34-0.3.*(Y-2))))-0.00092...

8 years ago | 0

Answered
Plotting 3 variables error
Replace figure; surf(x,t1,Te'); with [X,T1]=meshgrid(x,t1); Te=X+T1; %this is randomly selected function, you c...

8 years ago | 0

| accepted

Answered
Please help me convert equation to matlab code.
Basically, *Symbolic Toolbox* will help you: syms y(x) n f(x)=symsum((-1).^n*(x.^(2*n+1))/factorial(2*n+1),n,0,Inf)

8 years ago | 0

Answered
"Undefined function or variable 'x'." for input of function
Give *x* and *y* as input argument from outside as follows: x=1:7; y=x+3; Then call the function from command line, d...

8 years ago | 0

Answered
How o check if a number is a power of 3
Try this: syms x n=27; tol=1e-12; eq=3^x==n; sol=solve(eq,x); if ismembertol(double(round(sol)),double(sol),...

8 years ago | 0

Answered
How can I use integral in Matlab Function Block
Simulink only works with numerical data. You can not use *Symbolic Toolbox* inside Simulink. Since Simulink has its own timer...

8 years ago | 0

| accepted

Answered
The expression to the left of the equals sign is not a valid target for an assignment?
Defining equations require assignments, *with double equality sign*: eqns=[A + B == P + Q + R; A*Pa + B*Pb == P*Pp + Q*...

8 years ago | 0

Answered
What can you tell/deduce by looking at the plots of magnitude and phase of a frequency response function?
Okay, now I get it. Actually, there are lots of things to tell. For instance, by looking at the magnitude plot, you can see a...

8 years ago | 0

| accepted

Answered
is negative constant gain compensator can be applicable in a transfer function
Of course it can. Why not? But it won't result in any good situation. Run the attached model and play with it however you want. ...

8 years ago | 0

| accepted

Answered
Solving non-linear trigonometric equations with two unknowns.
syms Z1 x B1 = 0.002; B2 = 0.004; r = 1.8; eqns=[B1==1/(Z1*tan(x)); B2==1/(Z1*tan(r*x))]; sol=solve(eqns,[Z...

8 years ago | 1

Answered
How to replace all elements that are not even integers?
This should help: N=20;idx=1:N; while true v(idx)=randi([10 30],1,N); if all(mod(v,2)==0) break...

8 years ago | 0

| accepted

Answered
put headers in a matrix (but not in the first row)
Are you asking for something like this? ATab=array2table(A,'VariableNames',{'Height','Weight'}) If you need *headers* lik...

8 years ago | 0

Answered
How do I find the first x value when y crosses a threshold and remains above the threshold for 5 consecutive data points
Something like this? a=[1 2 4 5 8 7 9 6 8 2] th=4; low=find(a>=th,1,'first'); up=find(a>=th,1,'last'); if up-lo...

8 years ago | 0

Answered
Hello, I am having matlab output file containing NaN value and i want to calculate mean of the file eliminating NaN, Kindly help me out
Use *mean* with _omitnan_: mean(A,'omitnan') where A contains your data.

8 years ago | 0

Answered
Find a word in structure
One approach: structureA=struct; structureA.field1="cat"; strfind(structureA.field1,"cat") It will return *1* sinc...

8 years ago | 0

Answered
Substitute derivative array function
syms x; f(x)= exp(-x)-1+x F(x)= diff(f) xVal=[16.08554; 12.64465; 9.863738; 7.623176; 5.825013; 4.389056]; Fx=doub...

8 years ago | 0

| accepted

Answered
my own function is not working with 3x^2-12-15=0
Solve it *symbolically*: syms x eq=3*x^2-12*x-15==0 x=solve(eq,x)

8 years ago | 1

Load more