Respondida
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)

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

Respondida
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.

alrededor de 12 años hace | 0

Respondida
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)

alrededor de 12 años hace | 0

| aceptada

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

alrededor de 12 años hace | 2

| aceptada

Respondida
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,...

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

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

alrededor de 12 años hace | 0

| aceptada

Respondida
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(...

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 1

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

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

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

alrededor de 12 años hace | 1

Respondida
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 (...

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

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

alrededor de 12 años hace | 0

| aceptada

Respondida
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));

alrededor de 12 años hace | 0

Respondida
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);...

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 1

Respondida
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...

alrededor de 12 años hace | 2

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

alrededor de 12 años hace | 0

| aceptada

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

alrededor de 12 años hace | 0

| aceptada

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

alrededor de 12 años hace | 2

| aceptada

Respondida
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));

alrededor de 12 años hace | 0

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

Respondida
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...

alrededor de 12 años hace | 0

| aceptada

Respondida
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.

alrededor de 12 años hace | 0

Cargar más