Beantwortet
Hi I have a basic doubt about the integrator block in simulink
Sreerag, the integral of sine is a negative cosine plus an integration constant. Integrating a sine between 0 and pi results in ...

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
i had matrix s of size 4*12540, i want to take power of this matrix raise to 4*12540,how should i do it?
Amina, I am not sure I can follow. In general, if you need to take the nth power simply use n = 3; s3 = s.^n; or s...

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
Find the negative entries in a array.
E, use [row col] = find(a<0)

mehr als 12 Jahre vor | 2

Beantwortet
Where or How can I access past editions of the Matlab Digest?
MathWorks only publishes the current MATLAB Digest. All technical articles that have appeared in Digests are live in the <http:...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
Excluding specific elements from matrix index
Jonah, how about A(2,end-2:end) = 2 or, simply, A(2,2:4) = 2

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
Solve system of equations when symbolic vector is referencing its own elements?
Michael, use syms a1 a2 a3 a4 a5 a6 a7 a = [a1 a2 a3 a4 a5 a6 a7]'; eq = [ 2610.0 - 0.0001*a5 - 1.0e-6*a7 - 0.01*a3, ...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
How to record excution time of a subfunction during runtime?
Daniel, use <http://www.mathworks.de/de/help/matlab/ref/tic.html |tic|> and |toc|. tic [your subroutine call or commands] ...

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
Using An Equation As An Input Argument For A Function
Mike, check out the code below: function fun_test() f = @(x) x^8 - 1.5; xl = 0; xu = 1; sol = fun_solve(f, x...

mehr als 12 Jahre vor | 2

Beantwortet
Can you put a function inside a for loop?
Sure, e.g., a = [5 4 3 2]; for ii = 1:numel(a) b(ii) = times(a(ii),ii); end You can have any other function inst...

mehr als 12 Jahre vor | 0

Beantwortet
how to use a uitable to add two numbers
Sivakumaran, does this do the trick? f = figure('Position',[200 200 350 150]); a = 2; b = 4; dat = [a b a+b]; cna...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
Calculation the coordinate of a point
Mick, x2 = x1 + d*cos(al); y2 = y1 + d*sin(al); where |d| is the distance and |al| is the angle in rad measured between...

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
Vectors must be the same lengths
Daan, turn the script into a function and you should be good. As the first line in your code, add function myEuler() % or s...

mehr als 12 Jahre vor | 0

Beantwortet
Adding 3 numbers out of 5
Sarah, you could use data = [A B C D E]; datasum = sum(combnk(data,3),2);

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
How to change mathematical symbols of division (/ to ./) and multiplication(* to .*) in a very long formula obtained by symbolic tool.
Mahak, copy-paste the formula into a script/function editor and use CTRL+F to replace the strings.

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
Could you please tell me algorithm how to chose numbers in a matrix which is sastified a condition?
Luc, use a = [1 2 3;3 4 6;8 9 13]; [row col] = find(a>= 2 & a<=5); which will give you the row and colum indic...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
sprintf changes in each iteration
Md, do you mean something like for iFile=1:10 sprintf('A_%d_20%4d',iFile,1403-iFile+1) end To load a .mat file in...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
how to give three inputs to a scope block in simulink ?
Kishore, simply use a multiplexer (Mux) block (in > Commonly Used Blocks) to combine the signals into one vector signal. The vec...

mehr als 12 Jahre vor | 0

Beantwortet
How to extract certain rows of a matrix?
Mnr, you could use rows = find(all(data==0,2))

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
Finding varible in equation from vectors.
Giuseppe, use c = y - m.*x

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
How to Start simulating matlab code using raspberry pi
Nitesh, I recommend watching this <http://www.mathworks.com/videos/raspberry-pi-programming-using-simulink-81996.html?form_seq=c...

mehr als 12 Jahre vor | 0

Beantwortet
how do i change a scientific figures?
YJ, how about this: X = '0.0000012345'; Y = '0.0987654321'; strValues = sprintf('(%4.1e,%4.1e)',str2num(X),str2num(Y)); ...

mehr als 12 Jahre vor | 0

| akzeptiert

Beantwortet
How to delete leading zeros in a row vector in MATLAB?
If it's a vector of chars, this should do: data = regexprep(data,'^0*','')

mehr als 12 Jahre vor | 5

| akzeptiert

Beantwortet
Circshift not working for values of zero.
Use x_2 = circshift(x',-1,1)'

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
Can someone tell me where is the problem? Matlab doesnt want to show me the real and the imag part of equation
Stefan, the problem is that the real and imaginary parts depend on the values of the variables, of course. Let me illustrate wit...

mehr als 12 Jahre vor | 1

Beantwortet
how to construct the matrix of size 10x1000
Asram, by 10x1000 do you mean 10 columns, 1000 rows? mymat = ones(1000,1)*(1:10) or rather 10 rows, 1000 columns, where t...

mehr als 12 Jahre vor | 1

Beantwortet
Creating two vectors from one.
Giuseppe, use xr = x(1:end-1,1).*x(2:end,2) xr = -16 6 4 and equivalent for the other calculation.

mehr als 12 Jahre vor | 1

| akzeptiert

Beantwortet
How to cancel the shadow of the blocks in .mdl files? (Matlab 2013a)
Mike, select File > Simulink Preferences > Editor Defaults > Use classic diagram theme (in the Simulink model window).

mehr als 12 Jahre vor | 0

Beantwortet
Undefined function 'qquadrature' for input arguments of type 'double'
Note, that |qquadrature()| is not a built-in MATLAB function. What does MATLAB return for which qquadrature If it is ...

mehr als 12 Jahre vor | 0

Beantwortet
Plots for second order control system in the same graph
Carlos, check out function myDE() prompt = {'xmin:','xmax:'}; name = 'Input x-range'; numlines = 1; xlimits ...

mehr als 12 Jahre vor | 0

Mehr laden