Respondida
How to write a script for the following
f = @(t)5*t.^4-4.^t-t.^2-t+5; f(3)

más de 4 años hace | 0

Respondida
How do I plot the signal x(n)={1,2,3,2,1} with 3 as centre?
n = -2:2; x = [1 2 3 2 1]; stem(n,x)

más de 4 años hace | 1

Respondida
Applying whos to each field of a struct
The only problem with this that I see is that sub-structs get repeated in the output. See, e.g., 'teststruct.summary': load("te...

más de 4 años hace | 0

Respondida
collecting data for chi squared test
C = readcell('NSCLCR01Radiogenomic_DATA_LABEL.xlsx'); C(:,[4 6 8 10 18:end]) = []; headers = C(1,:); C(1,:) = []; t = cell2t...

más de 4 años hace | 0

| aceptada

Respondida
What is the syntax for specifying thresholding in wdenoise function?
wdenoise(Amps,7,'Wavelet', 'db2', 'DenoisingMethod', 'SURE')

más de 4 años hace | 1

| aceptada

Respondida
Automatically changing title based on a function input variables names
You could add a second input argument to your function (and don't call your function hist because that's already taken by a buil...

más de 4 años hace | 1

| aceptada

Respondida
How can I find the median of each element between 2 rows
% 3-by-10 matrix: M = rand(3,10); % median of each column: median(M,1) % 10-by-3 matrix: M = rand(10,3); % median of each ...

más de 4 años hace | 0

| aceptada

Respondida
How can I represent this equation on MATLAB: 𝑌[𝑛]=3𝑛2−1 𝑤ℎ𝑒𝑟𝑒 −2≤𝑛<3
n = -2:2; y = 3*n.^2-1; stem(n,y)

más de 4 años hace | 1

| aceptada

Respondida
I have a text file of two columns and multiple rows, I want to find the maximum value of column 2 and find the adjacent value in column 1.
data = readmatrix('test.txt'); [~,idx] = max(data(:,2)); result = data(idx,1); format long disp(result);

más de 4 años hace | 0

| aceptada

Respondida
i m trying interpret this simple matrix code..
rand('seed',345) B=randi([-150,300],10,7) [sorted_B_column_3,old_indices_in_B_column_3]=sort(B(:,3)) %using [y,in] this two v...

más de 4 años hace | 0

| aceptada

Respondida
I Want to change the last column of a cell 25*5 from characters ie {'Fd,Fc,Fb,Fr'} to numbers, [1,2,3,4]. the code must find for Ex. Fd and replace it with 1 and so on.Thanks
You can do this for each of the 11 cells: C = { ... 2.27000000000000 240.200000000000 49.6100000000000 0 'Fd' 2.45000...

más de 4 años hace | 0

Respondida
Export every third row from excel.
sheet = 1; data = zeros(97,0); while true try new_data = readmatrix('4.4.22.xlsx','sheet',sheet); catch ...

más de 4 años hace | 0

| aceptada

Respondida
Save a table of results to an Excel file
Here's one way you could save that 1x33 cell array into a single sheet of an xlsx file: % construct a cell array like yours, wi...

más de 4 años hace | 0

Respondida
Reading the data from one m file in another m file
Maybe you need to call CreateRandModel at the end of CreateModel? function model = CreateModel() % ... model.m=m; model.t1=t...

más de 4 años hace | 0

Respondida
extract data from string
Maybe something like this: str = '%R1P,0,0:0,0.452743429299473,0.000005129603507,0.0000002,0,0.000002,0,0,25899036'; % split...

más de 4 años hace | 1

| aceptada

Respondida
Generate expandable code for a particular matrix
N = 5; % The idea is to count up in binary from 0 to 2^N-1, % but use 1s and 2s instead of 0s and 1s, then place % the eleme...

más de 4 años hace | 0

Respondida
for loop help (turn on at a point and turn off when it drops to another point)
If I understand the situation, your code needs to have three outcomes: (1) turn the pump on, (2) turn the pump off, (3) leave th...

más de 4 años hace | 0

Respondida
Shaded region inside plot
x=[0:0.001:20]; y=(1/(2*0.2*9.81))*x.^2; z=x*(10*3.7/(((3)^(1/2))*0.2*9.81))^(1/2); colors = [ ... 1 1 0; ... % 1: ...

más de 4 años hace | 0

| aceptada

Respondida
How could I generate 10000 samples of a random variable using rand?
Use element-wise division ./ X= rand(1,10000); Y=rand(1,10000); k=(16*Y)./(X+23).^(Y+1); size(k)

más de 4 años hace | 1

| aceptada

Respondida
Help to fix error in interpolation in a structure
You might try using scatteredInterpolant instead of interp2. And I suspect "r134aPropertyTables.p" in your calls to interp2 shou...

más de 4 años hace | 0

Respondida
someone who can tell me my mistake why it doesn't graph me?????? QUESTION 14.
Maybe the plot command is never reached because of an error on the previous line: try % h convolves causal x close all; clc ...

más de 4 años hace | 0

Respondida
Not getting correct values on boxplot from imported excel data
readSwingVec = xlsread('DigiPractice.xlsx', 'Sheet1', 'A11:AT19'); readSwingAlp = xlsread('DigiPractice.xlsx', 'Sheet1', 'A2:AT...

más de 4 años hace | 1

| aceptada

Respondida
Reversing a part of matrix
i=sort(randsample(10,2)) % sort so that i(2) >= i(1) i1=i(1); i2=i(2); M=[10 20 30 40 50 60 70 80 90 100]; M_new = M; ...

más de 4 años hace | 0

Respondida
find count of elements in an array that meet certain condition
Maybe someone on a scilab forum can say how to do it in scilab, but in MATLAB you can do the following: ID = [5 9 5 9 0]; n_...

más de 4 años hace | 0

Respondida
Is it possible to change the name of Uicalender Object?
cal = uicalendar(); set(cal,'Name','new name');

más de 4 años hace | 1

| aceptada

Respondida
i want to draw a graph
You are missing a close parenthesis f=@(x)(exp(x).*sin(x)+(x./exp(x)) % ^ no matching close parenthesis for this That ope...

más de 4 años hace | 0

| aceptada

Respondida
getting an error in this code
Maybe finitepmf should be defined as follows: function pmf=finitepmf(sx,px,x) % finite random variable X: % vector sx of sa...

más de 4 años hace | 0

Respondida
Index in Positon 1 is invalid
Indexing in MATLAB starts at 1, so when n == 0, referring to xv(n,:) gives you that error. One way to fix it is to add 1 to n w...

más de 4 años hace | 0

| aceptada

Respondida
Read text file data
You can generate the file names in sequence like this: for ii = 1:100 filename = sprintf('%03d_EQ.txt',ii); % then re...

más de 4 años hace | 0

Respondida
How making discrete signal graphic image {xn} with data?
Maybe something like this xn = [0 0 1 2 2 1 0 2 0 0]; stem(xn)

más de 4 años hace | 0

Cargar más