Risposto
Find empty cells in 3D cell?
Try this: [r,c] = find(cellfun(@isempty,channelResp)); [nR,nC,nD] = size(channelResp); Dep = floor(c/nC-0.0001)+1; Col = c -...

oltre 6 anni fa | 0

| accettato

Risposto
How to do function shift in MATLAB?
Try: function [ func_up ] = FuncShift( func, shift ) func_up = @(x)(func(x)+shift); end

oltre 6 anni fa | 1

Risposto
\graphing witth multiple functions
Try : a = gca; hold on plot(a.XLim,[560, 560],'m--') % plots horizontal line at y = 560 To find the intersection point at y ...

oltre 6 anni fa | 0

| accettato

Risposto
How to find the nth is the higher than and closest to 0.3
One of the several ways: A=[5 56 6.1 0.29 0.32 15 ]; [vec,ind] = sort(A); id = find(vec>0.3,1); rqd_value = vec(id) % Requi...

oltre 6 anni fa | 0

Risposto
Plotting multiple 3D plots on one graph
Try : figure (4) grid on hold on % Hold position should be at the start of plotting to overlap plots plot3(cm_willans,pma_14...

oltre 6 anni fa | 0

| accettato

Risposto
Specifying the colour of a scatter plot
Try: scatter (x, y, 'filled', 'MarkerEdgeColor',[255, 66, 0]/255, 'MarkerFaceColor',[255, 66, 0]/255); to change tick labels f...

oltre 6 anni fa | 0

| accettato

Risposto
How to convert time domain to frequency domain
Replace the following line : subplot(2,1,4);plot(t,z); figure; by the following code nfft = length(y); f = (0:1/nfft:1-1/nf...

oltre 6 anni fa | 0

| accettato

Risposto
Code following function?
Try this: z = zeros(size(y)); z(y>0) = 1; z(y<0) = -1;

oltre 6 anni fa | 1

| accettato

Risposto
how to find the eigen value and plot them?
To find the eigen values you can use : e = eig(A); help eig % for more information on eigen function and how to use it and ...

oltre 6 anni fa | 0

Risposto
Low, High, and Band pass filter
Assuming you can interpolate the data and make altitude to vary at fixed step of 0.02 km and 1km equivalent to 1sec. To make bu...

oltre 6 anni fa | 1

| accettato

Risposto
matrix dimension must agree
In line, tl=(0:L-1).*Ts; Ts is of dimension 1x199 and you are muliplying it with a vector of dimesion 1x1500. Since, you are ...

oltre 6 anni fa | 0

Risposto
Calculate continuous Fourier Series for 50 coefficients
Try this : r = @(x)0; f = @(x) cos(3*x) - 0.5*sin(5*x) + 0.05*cos(54*x); a0 = (1/pi)*integral(f,-pi,pi); a50 = @(x) (1/pi)*i...

oltre 6 anni fa | 1

| accettato

Risposto
Creating Vector using MATLAB
Try Out = mean(X,1); % for row wise mean

oltre 6 anni fa | 0

| accettato

Risposto
How do I fix this code to get a proper moving average plot?
Your basic function 'running_avg' seeems to be working perfectly. However, If you want answers exactly as you would get using mo...

oltre 6 anni fa | 0

| accettato

Risposto
How to find the index in a row vector where a number exceeds a certain value?
Try : A = 1:100; lim = 50; ind = find(A>lim,1); %% Here 1 after comma suggests the first element that is greater than 50 In ...

oltre 6 anni fa | 0

| accettato

Risposto
Labels dont show up
One way to do this : f = @(t,y) t*y-y; y0 = 0.5; t = 0:0.2:1; [t,y1] = euler(f,t,y0); plot(t,y1,'DisplayName','Euler 0....

oltre 6 anni fa | 0

Risposto
Why in the for cycle the values of the first row of the matrix y(i,j) don't exist?
I think FUNCTIONALITY13 is being updated after each i, so FUNCTIONALITY13 is not storing all the values as matrix. You might w...

oltre 6 anni fa | 1

Risposto
Creating a graph of sin(x) and the taylor series for its approximation
Change the line x=linspace(0,100,2*pi); by x=linspace(0,2*pi,100); I hope it helps !

oltre 6 anni fa | 1

Risposto
Surf plot using meshgrid
Try this : snr_data = xlsread('snr values.xlsx'); depth = [1,2,3,5]; level = 1:7; depth_mesh = meshgrid(depth,level).'; lev...

oltre 6 anni fa | 1

| accettato

Risposto
resistors in a circuit
Try this : r3 = 100; % for example Volt_func = @(r)1.24*(r(1)*r(2)+r(2)*r3+r3*r(1))/r(1)/r(2); rout = lsqnonlin(Volt_func,...

oltre 6 anni fa | 0

| accettato

Risposto
How to implement a formula involving several elements of the same vector?
There are several way to do this, but most basic would be to use 'for' loop to get the feeling of how Matrix indexing works: Pe...

oltre 6 anni fa | 1

| accettato

Risposto
how to call multiple access file from one folder in matlab
One of the several ways to do this : clear all, close all, clc PathName = 'C:\Users\.......\0 degree\'; % Set the path where f...

oltre 6 anni fa | 0

Risposto
Index exceeds matrix dimensions.
P2 is an array of dimesion 1x199 and L=1500. So, when you write : P1=P2(1:L./2+1); that means P1 = P2(1:751); So, indeces of...

oltre 6 anni fa | 0

| accettato

Risposto
convert min, hours to 00:00:00 format
Use datestr() to convert number to time x = 15; if x>=60 out = datestr(x/24/60,'HH:MM:SS') else out = datestr(x/24...

oltre 6 anni fa | 0

Risposto
How to solve two differential equations using ode45
Are you sure, e1,e2,c1,c2 are time-variant and not constant ? If they are time-variant then there should be differential terms o...

oltre 6 anni fa | 0

| accettato

Risposto
How do I plot every 10th row of data?
One way to do this efficiently would be to scan the data inside the file at once (instead of doing it one by one in a loop) : ...

oltre 6 anni fa | 0

| accettato

Risposto
how do I insert a custom power curve?
Looks like a "1-D Lookup Table" block in simulink. For more details refer to following link : 1-D Lookup Table

oltre 6 anni fa | 2

| accettato

Risposto
How can I fill an array with varying input dimensions and data type change?
Try this: last_digit_vec = mod(Generator,10); v = {}; for i = 1:length(Generator) v = [v,eval(['mod',num2str(last_digit_...

oltre 6 anni fa | 1

| accettato

Risposto
how to use the row&column indices returned by find to control array element in matrix way
One of the way could be to use absolute indexing of X matrix : ind = find(X==1); ex(ind)=ex(ind)+0.5*(data(ind)-data(ind-je));...

oltre 6 anni fa | 0

| accettato

Risposto
check inside cell condition
Try this: for i = 1:length(AppleDECB) if ~ischar(AppleDECB{i}) % check if cell doesn't contain char continue; ...

oltre 6 anni fa | 0

| accettato

Carica altro