Réponse apportée
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)

environ 12 ans il y a | 0

Réponse apportée
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...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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.

environ 12 ans il y a | 0

Réponse apportée
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)

environ 12 ans il y a | 0

| A accepté

Réponse apportée
Function to extract certain elements from a matrix
Ciuban, use B = A(:,A(1,:)==1)

environ 12 ans il y a | 2

| A accepté

Réponse apportée
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,...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 12 ans il y a | 0

| A accepté

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

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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(...

environ 12 ans il y a | 0

Réponse apportée
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...

environ 12 ans il y a | 0

Réponse apportée
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...

environ 12 ans il y a | 0

Réponse apportée
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...

environ 12 ans il y a | 1

Réponse apportée
How can extract only real values of a matrix
Tinkul, use real(A)

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 12 ans il y a | 0

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

environ 12 ans il y a | 1

Réponse apportée
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 (...

environ 12 ans il y a | 0

Réponse apportée
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...

environ 12 ans il y a | 0

Réponse apportée
how to change displayed format of numbers?
Dominika, use A = vpa(solve(...)) or A = vpasolve(...)

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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));

environ 12 ans il y a | 0

Réponse apportée
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);...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 12 ans il y a | 1

Réponse apportée
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...

environ 12 ans il y a | 2

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

environ 12 ans il y a | 0

| A accepté

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

environ 12 ans il y a | 0

| A accepté

Réponse apportée
increment values which are larger than three
Sososasa, use B = A + (A>3)

environ 12 ans il y a | 2

| A accepté

Réponse apportée
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));

environ 12 ans il y a | 0

Réponse apportée
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...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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...

environ 12 ans il y a | 0

| A accepté

Réponse apportée
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.

environ 12 ans il y a | 0

Charger plus