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 ...

6 years 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...

6 years 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...

6 years 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)...

6 years 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...

6 years ago | 3

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)));

6 years ago | 0

Solved


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

6 years 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...

6 years ago | 1

| 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) + ...

6 years 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)...

6 years 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...

6 years 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); ...

6 years 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 ...

6 years 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...

6 years ago | 0

| accepted

Submitted


MATLAB comment remover
This tool removes the all comments from MATLAB file.

6 years ago | 1 download |

5.0 / 5
Thumbnail

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...

6 years 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...

6 years 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...

6 years ago | 0

| accepted

Solved


Remove the two elements next to NaN value
The aim is to *remove the two elements next to NaN values* inside a vector. For example: x = [6 10 5 8 9 NaN 23 9 7 3 21 ...

6 years ago

Answered
Hi all, I want help regarding loops in MATLAB, such that each iteration take values from a data set with the step size of 5? Which loop is most suitable?
For step size of 5 values = 1:5:n; % n is the required length of your data Refer the documenations on loops and colon oper...

6 years ago | 1

| accepted

Answered
How to plot two calculated values in for loop ?
Hi Bora KAMACI , What is the need of the for loops over here? We can notice in your code that you used Solve systems of linear...

6 years ago | 1

| accepted

Answered
how do you make a GUI editable textbox empty by default?
1) Editable UIControl property need to be empty string i.e delete string(default string is Edit Text) and put the empty string w...

6 years ago | 0

Answered
mean value of array between values
Yes, your thought is right mean_value_ex = (sum(a(:))-(max(a(:))+min(a(:)))/ (numel(a)-2))

6 years ago | 1

| accepted

Answered
if else Problem in matlab
In C/C++ progromming language the symbol '%' used for remining value but in the MATLAB the percentile symbol(%) used as commnet....

6 years ago | 0

| accepted

Solved


Multiply a column by a row
* Given a column vector C and and a row vector R. * Output a matrix M. * Every column of M equals to C multiplied by correspon...

6 years ago

Answered
Not sure why my code result in different graphics
You have made for loop mistake and indexing in your code, correct one is x = -pi : pi/500 : pi; y =zeros(1, length(x)); %...

6 years ago | 1

| accepted

Answered
Make this .mat variable DOUBLE- Help needed
Hi, load t; date_data = datetime(cell2mat(t)); % to get the all data as datetime format date_data_double = datevec(date_d...

6 years ago | 1

| accepted

Answered
Can anyone help? I cannot figure out how to use a for loop to check elements in part of a matrix.
No need of for loop r=randi([-10,10],5,4); if any(r(:,1)<0) r(1,:) = nan; end

6 years ago | 0

Answered
eval(sprintf('left = X+X%d+X%d+X%d+X%d+X%d+X%d', i==1:6)); throws error Undefined function or variable 'X0'. why
I support Daniel M answer. But if you need answer anyway these are the resolutions From your question it is clear that X0 is ...

6 years ago | 0

Answered
I am trying to create a game where a user guesses a number between 1 and 100 using a while loop. But I am getting stuck in an infinite loop. Please help?
Here you have made some mistakes 1) Gerenating vector instead of single random number y=randi(1,100); % Which generates th...

6 years ago | 0

Load more