Beantwortet
I have an array of angles and I need to identify periods where this array is above or below certain thresholds
Use array_ind = find(array<15 | (array>=165 & array<=195) | array>345)

etwa 12 Jahre vor | 0

Beantwortet
writing two integer together into edit text.
Use something like c = sprintf('%d%d',a,b); set(handles.edit_text, 'String', c); where the UI control is called |handl...

etwa 12 Jahre vor | 0

| akzeptiert

Beantwortet
How to convert matlab code in cpp
ECG, you need the <http://www.mathworks.de/products/matlab-coder/ MATLAB Coder> to generate C/C++ code.

etwa 12 Jahre vor | 0

Beantwortet
How to draw a 3D plot of a function in form y=f(X) and X is an array [X(1),X(2)] ?
Sadeg, use something like [X,Y] = meshgrid(0:0.1:1); Z = sin(X).*cos(3*Y).^2; surf(X,Y,Z)

etwa 12 Jahre vor | 0

| akzeptiert

Beantwortet
Function to extract certain elements from a matrix
Ciuban, use B = A(:,A(1,:)==1)

etwa 12 Jahre vor | 2

| akzeptiert

Beantwortet
how to execute loop again and again without double executing the program?
Kanu, something like (not optimized) ... exitFLAG = true; while exitFLAG [x,y] = ginput(2) if ~strcmp(get(gcf,...

etwa 12 Jahre vor | 0

| akzeptiert

Beantwortet
negative zero as eigenvalue
Suma, it's not really zero. Set the display format to long fixed decimal: format long [v, d] = eig(a) v = 0.38133397...

etwa 12 Jahre vor | 0

| akzeptiert

Beantwortet
how to calculate f(x) = a*x^b+c
Rupraj, use f = a*x^b + c This should result in f = 2.009395380889448e+02

etwa 12 Jahre vor | 0

| akzeptiert

Beantwortet
problem with plotting differential equation
Goran, use something like function myODE() tspan = 0:0.1:10; IC = 1; [t,y] = ode45(@ODEfun,tspan,IC); plot(...

etwa 12 Jahre vor | 0

Beantwortet
How to find an approximate solution to a perturbed differential equation in Matlab?
Connie, the unperturbed differential equation is simply x'' - x = 0 % or should it rather say x'' + x = 0? which you ca...

etwa 12 Jahre vor | 0

Beantwortet
Simulink support package for Arduino - Combining with cusom code?
Alex, you can implement MATLAB code (is this what you are referring to as custom code?) in Simulink, e.g., via the MATLAB functi...

etwa 12 Jahre vor | 0

Beantwortet
How to compute the sum of the squares of all integers from 1 to 50 using for-loop?
OK, use mysum = 0; for ii = 50:-1:1 mysum = mysum + ii*((51-ii) + ii)^2; end Of course you could simplify, since...

etwa 12 Jahre vor | 1

Beantwortet
How can extract only real values of a matrix
Tinkul, use real(A)

etwa 12 Jahre vor | 0

| akzeptiert

Beantwortet
Add arrows to a graph
JMS, if you are talking about the vector field, use <http://www.mathworks.de/de/help/matlab/ref/quiver.html |quiver|>. For label...

mehr als 12 Jahre vor | 0

Beantwortet
Calculate differences between all values in vector
Swisslog, you could use pdist([2 3 1 4]',@(x,y) x-y)

mehr als 12 Jahre vor | 1

Beantwortet
How can I change the colour background in a region using plot?
Diego, you could plot a properly sized <http://www.mathworks.de/de/help/matlab/ref/rectangle.html |rectangle|> on top of which (...

mehr als 12 Jahre vor | 0

Beantwortet
interfacing b/w motor and wheel model
Shahzor, I believe what you are looking for are the Simulink-PS and PS-Simulink Converter blocks. They are located in the Simsca...

mehr als 12 Jahre vor | 0

Beantwortet
how to change displayed format of numbers?
Dominika, use A = vpa(solve(...)) or A = vpasolve(...)

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
decimal matrix to binary matrix
Kiran, try B = arrayfun(@(ii,jj) {dec2bin(A(ii,jj))},repmat((1:size(A,1))',1,size(A,2)),repmat((1:size(A,2)),size(A,1),1));

mehr als 12 Jahre vor | 0

Beantwortet
How to create a continuos surface in 3D
How about doing it from scratch? x = -2:0.1:2; y = -2:0.1:2; [X,Y] = meshgrid(x,y); Z = X.*exp(-(X - Y.^2).^2 - Y.^2);...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
Solving Linear System of Equations.
Salaheddin, the rank of |a| is 2, one solution (by inspection) is, e.g. 15/14*a(:,1) + a(:,2) - 2.5*a(:,3) You could also...

mehr als 12 Jahre vor | 1

Beantwortet
Numerically Solving a System of Differential Equations in Parallel?
Kevin, check out this <http://www.mathworks.de/matlabcentral/answers/116782-how-to-plot-phase-plane-in-matlab#answer_125728 answ...

mehr als 12 Jahre vor | 2

Beantwortet
Delaying the input of a System
Sai, use u = sin(2*pi*fm*(t-t(6)))'; u(1:5) = 0;

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
multiple inputs for a function
Giuseppe, you could use function ispal = palindrome(forward_string) for ii=1:numel(forward_string) ispal{ii} = strcmp...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
increment values which are larger than three
Sososasa, use B = A + (A>3)

mehr als 12 Jahre vor | 2

| akzeptiert

Beantwortet
How to make up the diagonal summation without for loop and with the fastest way!
Hyunchul, something like fA = fliplr(A); B = fliplr(arrayfun(@(i) sum(diag(fA,i)),-length(A(:,1))+1:length(A(1,:))-1));

mehr als 12 Jahre vor | 0

Beantwortet
How do you multiply one single constant value with a 1D array/matrix containing 25 values in Simulink?
James, simply use a Gain block (Commonly Used Blocks) and choose Element-wise multiplication (double-click to open the block). T...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
help with plotting smooth curve
Arnav, use global Z_hit theta1 = 1:2:20; data = zeros(1,numel(theta1)); for ii=1:numel(theta1) Z_hit = 3*((0...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
Adding all the elements of a 1-d matrix/array in Simulink
James, as you suggest, you could use a MATLAB function block (used to be called Embedded MATLAB function) with the following cod...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
How I can overlap two functions in Simulink?
Azz, what about simply adding the two signals? Use two Sine Wave source blocks and a Sum block.

mehr als 12 Jahre vor | 0

Mehr laden