MATLAB enthusiastic

Answered

how can i plot a power spectrum for my signal?

It is from the reference https://in.mathworks.com/help/matlab/math/basic-spectral-analysis.html N=1024; fs=1000; % signal ...

how can i plot a power spectrum for my signal?

It is from the reference https://in.mathworks.com/help/matlab/math/basic-spectral-analysis.html N=1024; fs=1000; % signal ...

etwa 19 Stunden ago | 0

Solved

Magic is simple (for beginners)

Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

ein Tag ago

Solved

Make a random, non-repeating vector.

This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

ein Tag ago

Solved

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

ein Tag ago

Solved

Swap the input arguments

Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

ein Tag ago

Solved

Maximum value in a matrix

Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

ein Tag ago

Answered

How to read data from a file with fixed format?

importdata gives you data in cell data type. A=importdata(test1); A = A{1}; % get the data from cell % now you will get v...

How to read data from a file with fixed format?

importdata gives you data in cell data type. A=importdata(test1); A = A{1}; % get the data from cell % now you will get v...

ein Tag ago | 0

Answered

want to join two audio files and write /save using audiowrite

First argument of the audiowrite is filename not variable need to be written, change accordingly See the help https://in.mathw...

want to join two audio files and write /save using audiowrite

First argument of the audiowrite is filename not variable need to be written, change accordingly See the help https://in.mathw...

4 Tage ago | 0

Answered

How can I generate changing length of legend for a scatter graph generated in a while loop?

M = [ 0.12 0.21 0.356 0.458 0.3659 0.2458 0.5412 0.324 0.2121]; M_2 = [0.35 0.56 0.12 0.321 0.987 0.88 0.44 0.66 0.23]; M_3 = ...

How can I generate changing length of legend for a scatter graph generated in a while loop?

M = [ 0.12 0.21 0.356 0.458 0.3659 0.2458 0.5412 0.324 0.2121]; M_2 = [0.35 0.56 0.12 0.321 0.987 0.88 0.44 0.66 0.23]; M_3 = ...

5 Tage ago | 0

Solved

Check if integer is a prime number

Check if integer i is a prime number. Returns logical true '1' if it is.

5 Tage ago

Solved

Check if number is a square number

Test if integer i is a square number. Return logical true if it is.

5 Tage ago

Answered

No jump in in if-query even though if-statement is true

I don't know,why are you taking variable jump_in. From your code we can summarize as % c- common values(X(x) == T(t)) % iX ...

No jump in in if-query even though if-statement is true

I don't know,why are you taking variable jump_in. From your code we can summarize as % c- common values(X(x) == T(t)) % iX ...

5 Tage ago | 0

Answered

removing non prime number function

In short your function, assuming you have the data format as you mentioned data = textread(' integersB.txt', '%d'); prime_numb...

removing non prime number function

In short your function, assuming you have the data format as you mentioned data = textread(' integersB.txt', '%d'); prime_numb...

9 Tage ago | 0

Answered

Randi Vector with constant increments

Set the limits as inc = 10000 % constant increment Then two random values as lower and upper limits of the vector ran...

Randi Vector with constant increments

Set the limits as inc = 10000 % constant increment Then two random values as lower and upper limits of the vector ran...

9 Tage ago | 1

| accepted

Answered

exit from the cycle

1) how to end a cycle when conditions are fulfilled for the first time Use break keyword to exit cycle as for i = 1:length(A)...

exit from the cycle

1) how to end a cycle when conditions are fulfilled for the first time Use break keyword to exit cycle as for i = 1:length(A)...

10 Tage ago | 1

Answered

setting column of a matrix to zero

a(:, 25:30) = 0; % all columns from 25 to 30 assigned as 0's Refer the link for the MATLAB matrix indexing https://in.math...

setting column of a matrix to zero

a(:, 25:30) = 0; % all columns from 25 to 30 assigned as 0's Refer the link for the MATLAB matrix indexing https://in.math...

10 Tage ago | 0

Answered

Using an equation to calculate value for each number in data set

Here is your equation P = 0.61121*exp((18.678-T/234.5).*(T./(257.14+T)));

Using an equation to calculate value for each number in data set

Here is your equation P = 0.61121*exp((18.678-T/234.5).*(T./(257.14+T)));

11 Tage ago | 0

Solved

All capital?

Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

12 Tage ago

Answered

How do i generate 10 random matrix and store them?

You can perform this using multi dimentional(here say rw = 10) array or cell array(prefered when random matrix size not consista...

How do i generate 10 random matrix and store them?

You can perform this using multi dimentional(here say rw = 10) array or cell array(prefered when random matrix size not consista...

12 Tage ago | 0

| accepted

Answered

Unable to store matrix array in for loop

t = linspace(10^-4,10^12,17); m = zeros(length(t),1); % initialize with zeros for i = 1:17 m(i) = inv((At * Cd * A) + ...

Unable to store matrix array in for loop

t = linspace(10^-4,10^12,17); m = zeros(length(t),1); % initialize with zeros for i = 1:17 m(i) = inv((At * Cd * A) + ...

12 Tage ago | 0

Answered

Create matrix (30 x 12) with numbers from 1 to 12 without repetition without any repetitions of following numbers for each row

Uniformly distributed pseudorandom integers using the command randi may produce as you require mat = randi([1, 12], 30, 12)...

Create matrix (30 x 12) with numbers from 1 to 12 without repetition without any repetitions of following numbers for each row

Uniformly distributed pseudorandom integers using the command randi may produce as you require mat = randi([1, 12], 30, 12)...

13 Tage ago | 0

Answered

How can I select a random numbers from an array in a repeating way?

len = length(time); % length of the vector time7 = zeros(1,len) ; % initilaize the vector time7 to store your time7 common_ti...

How can I select a random numbers from an array in a repeating way?

len = length(time); % length of the vector time7 = zeros(1,len) ; % initilaize the vector time7 to store your time7 common_ti...

13 Tage ago | 0

| accepted

Answered

How do I create a matrix surrounding the center element?

% works for only odd numbers as your requirement n = 5; % matrix size r = (n-1)/2; % surrounding rows x = zeros(n); ...

How do I create a matrix surrounding the center element?

% works for only odd numbers as your requirement n = 5; % matrix size r = (n-1)/2; % surrounding rows x = zeros(n); ...

13 Tage ago | 1

Answered

How to read multiple excel files with pattern in their names

% assuming working in the present working directory files = 1000:1000:100000; file_data = cell(1, length(files)); for iFile ...

How to read multiple excel files with pattern in their names

% assuming working in the present working directory files = 1000:1000:100000; file_data = cell(1, length(files)); for iFile ...

14 Tage ago | 0

Answered

How to plot the switching signal in matlab?

t=0:0.01:25; %time vector width = 4; % train width dela = width/2:width*2:25; % delays pulse_vect=pulstran(t,dela,'rectpu...

How to plot the switching signal in matlab?

t=0:0.01:25; %time vector width = 4; % train width dela = width/2:width*2:25; % delays pulse_vect=pulstran(t,dela,'rectpu...

14 Tage ago | 0

| accepted

Submitted

MATLAB comment remover

This tool removes the all comments from MATLAB file.

14 Tage ago | 4 downloads |

Answered

Calling in a function inside a for loop and storing each answer separetly

You have not provided the output varibles of the function engr3202_gsrelax(A,B,n,x,imax,es, w); Make output variables in the ca...

Calling in a function inside a for loop and storing each answer separetly

You have not provided the output varibles of the function engr3202_gsrelax(A,B,n,x,imax,es, w); Make output variables in the ca...

15 Tage ago | 1

Solved

Return elements unique to either input

Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

16 Tage ago

Answered

how to convert cell to matrix ?

No need of reguler expressions here fun = @str2num; segments1 = cell2mat(cellfun(fun, x, 'UniformOutput', false)); Produce 2...

how to convert cell to matrix ?

No need of reguler expressions here fun = @str2num; segments1 = cell2mat(cellfun(fun, x, 'UniformOutput', false)); Produce 2...

16 Tage ago | 0

| accepted