Beantwortet
Nested if statements done elsewise?
N = 5000; x = 2*rand(N,8) - 1; u = (x<0); v = (sum(u,2)==8);

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
Using if and then statements
function r = findQuadraticRoots(a,b,c) if something is true do some stuff; else ...

mehr als 8 Jahre vor | 0

Beantwortet
Transfer function in Simulink
H(s) = Y(s) / U(s)

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
How can I extract a single component from a Fourier decomposition of a 2D matrix and plot it as a 2D map?
Here's a start: [ M, N ] = size(PV); Fs_x = 1/dx; Fs_y = 1/dy; dF_x = Fs_x/M; dF_y = Fs_y/N; Fx = -F...

etwa 9 Jahre vor | 0

Beantwortet
plot vector where negative data is circled
isNeg = (data < 0); plot(abs(data),pos) hold on plot(abs(data(isNeg)),pos(isNeg),'o') set(gca,'xscale','log');

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
how can i add noise in particular place of the sine wave?
noise = [ zeros(N,1) ; rand(M,1) ]; distorted = source + noise;

etwa 9 Jahre vor | 0

| akzeptiert

Beantwortet
Passing a function value to another function
You could write a script that calls each of the functions one or more times in the desired sequence, passing the output of one f...

etwa 9 Jahre vor | 0

Beantwortet
Create a nxn matrix with the same values
B = 3*ones(9);

etwa 9 Jahre vor | 4

| akzeptiert

Beantwortet
Plot transfer function of band pass filter
doc fvtool doc freqz

etwa 9 Jahre vor | 0

Beantwortet
My code is just about there, but there is something not right...I can't figure it out. Help?!
The very first line inside the |for| loop is not correct: v(k)= a.*t; First of all, you need to define a time increment...

etwa 9 Jahre vor | 0

Beantwortet
Am I doing this right?
m = 1428.8; a_gas = 3; dt = 0.5; t = (0:dt:50)'; N = length(t); x = nan(N,1); v = nan(N,1); ...

etwa 9 Jahre vor | 0

Beantwortet
How do I plot Magnitude And Phase Response of a DT Signal
doc fft

etwa 9 Jahre vor | 0

Beantwortet
How do I show a subplot next to the other one?
figure; subplot(1,2,1); plot(...); subplot(1,2,2); plot(...);

etwa 9 Jahre vor | 1

Beantwortet
How create a calculator function ?
Here is a start: function y = calculator(a,b,t) % Insert your header comments here % % % insert you...

etwa 9 Jahre vor | 0

Beantwortet
Mex file still too slow
Please try: cfg.DynamicMemoryAllocation = 'off'; Also: cfg.IntegrityChecks = false; cfg.ResponsivenessChe...

etwa 9 Jahre vor | 3

Beantwortet
Do I convert the units?
Yes. I think Kp will remain unchanged, but Ki and Kd will both need to scale to account for the change in the time units.

etwa 9 Jahre vor | 0

Beantwortet
How do I get my script to produce a 2-D array?
n = 30; X = zeros(n+1,2); X(:,1) = 0:n; X(:,2) = ... disp(X);

etwa 9 Jahre vor | 0

| akzeptiert

Gelöst


Golden ratio
Calculate the golden ratio. Hint: phi^2 = phi + 1.

etwa 9 Jahre vor

Beantwortet
Plotting Step Responses with For Loops
figure; axes; hold on; for tau = 35:5:60 sys = tf([75],[tau 1]); [y,t] = step(sys); plot(t,25+y)...

etwa 9 Jahre vor | 1

| akzeptiert

Beantwortet
Vectorizing interdependent nested 4-for loop
# Did you pre-allocate |Aineq| prior to the loop? # Did you pre-allocate |bineq| prior to the loop?

mehr als 9 Jahre vor | 0

Beantwortet
Power Spectral Density two approaches
Please replace the following line of code: periodogram(y, rectwin(length(y)), [], fs, 'oneside', 'power'); with: ...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
Plotting a Complex exponential - G(e^jw)
N = 1024; dw = 2*pi/N; w = -pi:dw:pi-dw; s = exp(j*w); G = (s-a)./((s-b).*(s-c)); figure; plot(w,abs(G...

mehr als 9 Jahre vor | 3

Beantwortet
How to complete the fourier Analysis using Matlab ?
doc fft doc fftshift doc abs doc angle doc plot doc stem doc xlabel doc ylabel doc grid doc xlim ...

mehr als 9 Jahre vor | 1

| akzeptiert

Beantwortet
fft of a 2 simple cos functions
Replace the following line: f=(0:nfft/2-1)*Fs/nfft/2; with: f=(0:nfft/2-1)*Fs/nfft;

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
Mex speed slower on linux than Windows
They are not the same MEX function - different compilers, different instruction set architectures, different assemblers, differe...

mehr als 9 Jahre vor | 3

Beantwortet
How to force MATLAB Coder to not combine two functions into one?
Insert the following line of code in any MATLAB a function that you want to have as a separate function in the generated C code:...

mehr als 9 Jahre vor | 2

| akzeptiert

Beantwortet
Read some images from one folder contain on many images
for k = [ 1 5 13 20 21 30 33 40 48 ] filename = sprintf('P%i.png',k); X = imread(filename); Y...

mehr als 9 Jahre vor | 1

Beantwortet
error with 8psk modulation
Instead of data = randi([0 1],4000,1); please try data = randi([0 1],3000,1);

mehr als 9 Jahre vor | 0

Beantwortet
Superimposing two figures on the top of each other
m = 1800 / ( 3 - -3) ; dx = 1800 / 2 ; u = m*x + dx ; n = 1000 / ( 1.6 - -1.6 ) ; dy = 1000 / 2 ; v =...

mehr als 9 Jahre vor | 0

| akzeptiert

Beantwortet
Generate Code with Structure with Different Size Matrices
doc coder.varsize

mehr als 9 Jahre vor | 0

| akzeptiert

Mehr laden