MATLAB enthusiastic

Answered

I want to display my result in a output file but idk how to do that.

xlswrite('output_file.xlsx', [cellstr(num2str(grade)), cellstr(data.grade)]);

I want to display my result in a output file but idk how to do that.

xlswrite('output_file.xlsx', [cellstr(num2str(grade)), cellstr(data.grade)]);

environ 6 heures ago | 0

Answered

How to get specific data from specified rows and variables in a table?

S = A -table2array(Table(1, 2)); % where Table(1, 2) indicates 1 row second column i.e Sensitivity values of "COB4_St1" For ...

How to get specific data from specified rows and variables in a table?

S = A -table2array(Table(1, 2)); % where Table(1, 2) indicates 1 row second column i.e Sensitivity values of "COB4_St1" For ...

environ 20 heures ago | 0

Answered

Force stop the program if the input doesn't satisfies some conditions

b=('another input= '); %Not really necessary. while 1 a=input('input any number less than or equal to 0,01= '); if a<...

Force stop the program if the input doesn't satisfies some conditions

b=('another input= '); %Not really necessary. while 1 a=input('input any number less than or equal to 0,01= '); if a<...

environ 21 heures ago | 0

| accepted

Answered

while loop: storing changing variables

i = 1; T1 = %%initial temperature tmp = zeros(1, 100000); % initialize temparature with zeros of length 100000 tmp(1) = ...

while loop: storing changing variables

i = 1; T1 = %%initial temperature tmp = zeros(1, 100000); % initialize temparature with zeros of length 100000 tmp(1) = ...

3 jours ago | 0

Answered

How to skip values in matrix and plot it properly

As of my knowledge, we can't plot NaNs so there is 3 points are visible in your plot as A = [0, 0, 3, 4, 0, 0]; B = [0, 1, 4, ...

How to skip values in matrix and plot it properly

As of my knowledge, we can't plot NaNs so there is 3 points are visible in your plot as A = [0, 0, 3, 4, 0, 0]; B = [0, 1, 4, ...

4 jours ago | 1

Answered

How to execute files without specifying a path.

You can but Files shold be in present working directory Program(here xxx.exe) should set to environmental variable if it is no...

How to execute files without specifying a path.

You can but Files shold be in present working directory Program(here xxx.exe) should set to environmental variable if it is no...

4 jours ago | 0

Answered

Looping each pixel of matrix image

If input image is color image X = imread('img.jpg'); Val = zeros(numel(X)); % initialize pdf values storing variable with...

Looping each pixel of matrix image

If input image is color image X = imread('img.jpg'); Val = zeros(numel(X)); % initialize pdf values storing variable with...

4 jours ago | 0

| accepted

Answered

help deleting rows with column value in a table of data

Suppose your table data stored in the variable T T(find(T.ARRAY == 2),:) = [];

help deleting rows with column value in a table of data

Suppose your table data stored in the variable T T(find(T.ARRAY == 2),:) = [];

4 jours ago | 0

Answered

how to Specify Time Zones?

Given mat file contains series date numbers. Instead of taking time zone as '+HH:mm' format specify local area string as 'Asia/K...

how to Specify Time Zones?

Given mat file contains series date numbers. Instead of taking time zone as '+HH:mm' format specify local area string as 'Asia/K...

7 jours ago | 0

Answered

Use generic matrix an input into a function in MATLAB

function output = iszero(Z) output = any(diag(Z) == 0); end

Use generic matrix an input into a function in MATLAB

function output = iszero(Z) output = any(diag(Z) == 0); end

7 jours ago | 0

| accepted

Answered

How to find minimum values of all lines on matrix?

B = min(A, [], 2);

How to find minimum values of all lines on matrix?

B = min(A, [], 2);

7 jours ago | 1

| accepted

Answered

Add a vector to a matrix if satisfies one condition

col_3 = A(:, 3); % 3rd column of A con = col_3(2)- 1> B(end) >col_3(end)+1; % your condition if cond C = [A;B]; ...

Add a vector to a matrix if satisfies one condition

col_3 = A(:, 3); % 3rd column of A con = col_3(2)- 1> B(end) >col_3(end)+1; % your condition if cond C = [A;B]; ...

8 jours ago | 0

Answered

Trying to make every odd number zero in a vector

x(find(mod(x, 2))) = 0; or x(1:2:end) = 0;

Trying to make every odd number zero in a vector

x(find(mod(x, 2))) = 0; or x(1:2:end) = 0;

8 jours ago | 0

Answered

Storing values in a loop

Already your 20000 iterations of the x is stored in the variable in x and for the histogram use command as hist(x)

Storing values in a loop

Already your 20000 iterations of the x is stored in the variable in x and for the histogram use command as hist(x)

9 jours ago | 0

Answered

while loop multiple conditions

eps=ones(1,n_windings)*0.01; T_WATERback=ones(1,n_windings)*T_water_hp; T_WATERfront=T_WATER; T_WIREback=ones(1,n_windings)*(...

while loop multiple conditions

eps=ones(1,n_windings)*0.01; T_WATERback=ones(1,n_windings)*T_water_hp; T_WATERfront=T_WATER; T_WIREback=ones(1,n_windings)*(...

10 jours ago | 0

Answered

Could anyone help me how to rearrange the matrix in the descending order with respect to the values in another matrix.

[~, b] = sort(c, 'descend');

Could anyone help me how to rearrange the matrix in the descending order with respect to the values in another matrix.

[~, b] = sort(c, 'descend');

10 jours ago | 0

| accepted

Answered

How to turn existing code into app and which components to use?

You can use any action UI control button in app designer, suppose mostly used one is push button. In the respective UI control ...

How to turn existing code into app and which components to use?

You can use any action UI control button in app designer, suppose mostly used one is push button. In the respective UI control ...

10 jours ago | 0

| accepted

Answered

how will I replace a string with another string without using strrep?

Can I use regexprep command ??, If yes function newstring = replace_tags(readstring,tag,replacement) r_s=lower(readstring)...

how will I replace a string with another string without using strrep?

Can I use regexprep command ??, If yes function newstring = replace_tags(readstring,tag,replacement) r_s=lower(readstring)...

10 jours ago | 0

Answered

add matrix to cell

I guese you want like this?? A=rand(25,25); B=fliplr(A(2:25,:)); % only line no 2 C= nan(25,25); C(2:25, :) = B; % assign...

add matrix to cell

I guese you want like this?? A=rand(25,25); B=fliplr(A(2:25,:)); % only line no 2 C= nan(25,25); C(2:25, :) = B; % assign...

11 jours ago | 0

| accepted

Answered

How to plot for for a range? showing error

Your code t = 0:0.001:1; D = (117649*exp(4*t))/6561- (117649*exp(4*t))/26244 - (117649*t.^2.*exp(4*t))/4374 - ... (117649...

How to plot for for a range? showing error

Your code t = 0:0.001:1; D = (117649*exp(4*t))/6561- (117649*exp(4*t))/26244 - (117649*t.^2.*exp(4*t))/4374 - ... (117649...

12 jours ago | 0

| accepted

Answered

Looping for storing differet matrix in different rows but in same matrix.

In simple way Calculated_Data = reshape([alpha_data{:}],6,79); In for loop Calculated_Data = zeros(6, 79); k = 1; % count...

Looping for storing differet matrix in different rows but in same matrix.

In simple way Calculated_Data = reshape([alpha_data{:}],6,79); In for loop Calculated_Data = zeros(6, 79); k = 1; % count...

12 jours ago | 0

Answered

Easier ways to write this scipt.

clear; clc; balance = 1000;%initial deposit deposit = 500; %yearly deposit APR = 0.04; %interest rate % years =[0:14]; %yea...

Easier ways to write this scipt.

clear; clc; balance = 1000;%initial deposit deposit = 500; %yearly deposit APR = 0.04; %interest rate % years =[0:14]; %yea...

12 jours ago | 0

Answered

my Plot not showing a line only the points

If you need plot as line in anyway take additional variables to plot it % Numerical Method of Solving ODE \ Euler Method% % '...

my Plot not showing a line only the points

If you need plot as line in anyway take additional variables to plot it % Numerical Method of Solving ODE \ Euler Method% % '...

15 jours ago | 1

Answered

Vectorization of a for loop

% assuming fake data filteredArray = [8 3 5 6 10 5 10 4 8 7]; inputScalar = 5; % then appl...

Vectorization of a for loop

% assuming fake data filteredArray = [8 3 5 6 10 5 10 4 8 7]; inputScalar = 5; % then appl...

16 jours ago | 0

| accepted

Answered

Importing three .txt files into a structure and then do calculations and form graph.

You said text file contains 31 columns but it has 19 columns only(attached file) You are able to get data for 19 colums from yo...

Importing three .txt files into a structure and then do calculations and form graph.

You said text file contains 31 columns but it has 19 columns only(attached file) You are able to get data for 19 colums from yo...

17 jours ago | 0

Answered

How to pick a corresponding value during a for loop run

It is possible, only if both variable scores and 0:Dtetha:Dmax(direction) lengths are equal function D_auto = response(x) % ...

How to pick a corresponding value during a for loop run

It is possible, only if both variable scores and 0:Dtetha:Dmax(direction) lengths are equal function D_auto = response(x) % ...

17 jours ago | 0

| accepted

Solved

"Low : High - Low : High - Turn around " -- Create a subindices vector

Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

17 jours ago

Answered

Create a string array (MxN) where each element is a repeated character based off a numeric array (MxN)

B = string(cellfun(@(x)repelem('#', x), num2cell(A), 'UniformOutput', false));

Create a string array (MxN) where each element is a repeated character based off a numeric array (MxN)

B = string(cellfun(@(x)repelem('#', x), num2cell(A), 'UniformOutput', false));

18 jours ago | 2

| accepted

Answered

Cartesian to polar matrix

Ybus = [ 20-j*50 -10+j*20 -10+j*30 -10+j*20 26-j*52 -16+j*32 -10+j*30 -16+j*32 26-j*62]; [angle_Ybus, rh...

Cartesian to polar matrix

Ybus = [ 20-j*50 -10+j*20 -10+j*30 -10+j*20 26-j*52 -16+j*32 -10+j*30 -16+j*32 26-j*62]; [angle_Ybus, rh...

18 jours ago | 0

Answered

How can i get matrix element for a complex values?

% suppose a fake matrix with size 3x3 >> A = rand(3); A = 0.7922 0.0357 0.6787 0.9595 0.8491 0.7577 ...

How can i get matrix element for a complex values?

% suppose a fake matrix with size 3x3 >> A = rand(3); A = 0.7922 0.0357 0.6787 0.9595 0.8491 0.7577 ...

18 jours ago | 0