Answered

Rearrange matrix rows in specific order

Matrix_A = [1 1 1;2 2 2;3 3 3 ; 4 4 4; 5 5 5; 6 6 6; 7 7 7] Inp = [2 3 4 5 1 6 7]; Output = Matrix_A(Inp,:)

Rearrange matrix rows in specific order

Matrix_A = [1 1 1;2 2 2;3 3 3 ; 4 4 4; 5 5 5; 6 6 6; 7 7 7] Inp = [2 3 4 5 1 6 7]; Output = Matrix_A(Inp,:)

1 year ago | 0

Answered

How to find pythagorean triangle's hypotenuse in a matrix?

a = [5 8 12 3; 8 12 63 20; 9 84 144 20; 24 11 15 180]; b = [12 6 5 4; 15 35 16 21; 40 13 17 99; 7 60 112 19]; c=[]; for i =1 ...

How to find pythagorean triangle's hypotenuse in a matrix?

a = [5 8 12 3; 8 12 63 20; 9 84 144 20; 24 11 15 180]; b = [12 6 5 4; 15 35 16 21; 40 13 17 99; 7 60 112 19]; c=[]; for i =1 ...

1 year ago | 0

| accepted

Answered

Cell concatenation error with cells with values below 1 and above 1

You can use char command @Christina Huynh a = {'0.10297';'0.54312';'0.98275';'1.4219';'1.8605'}; Output = char(a) And it wa...

Cell concatenation error with cells with values below 1 and above 1

You can use char command @Christina Huynh a = {'0.10297';'0.54312';'0.98275';'1.4219';'1.8605'}; Output = char(a) And it wa...

1 year ago | 0

Answered

Select table data by Date

dates = [datetime('today'); datetime('Yesterday') ;datetime('tomorrow')]; data = [-0.1 ; 0 ;0.1]; T = table(dates,data) FindD...

Select table data by Date

dates = [datetime('today'); datetime('Yesterday') ;datetime('tomorrow')]; data = [-0.1 ; 0 ;0.1]; T = table(dates,data) FindD...

1 year ago | 0

| accepted

Answered

how to identify and read positive and negative data from excel?

[num data raw] = xlsread('Abb73at100.xlsx'); % get data in two columns col_1 = num(:,1); col_2 = num(:,2); % get negative in...

how to identify and read positive and negative data from excel?

[num data raw] = xlsread('Abb73at100.xlsx'); % get data in two columns col_1 = num(:,1); col_2 = num(:,2); % get negative in...

1 year ago | 0

| accepted

Answered

how to print first business dates between years using loops?

alldates = {}; for year =2010:2020 for month=1:12 alldates{end+1}= datestr(fbusdate(year,month)); end end v...

how to print first business dates between years using loops?

alldates = {}; for year =2010:2020 for month=1:12 alldates{end+1}= datestr(fbusdate(year,month)); end end v...

1 year ago | 0

| accepted

Answered

Extract Data from .txt File

alltext = fileread('Datos_SSB_624_MHz_7_dB.txt'); % extract data between {"peakEvm": and }, allmatches = regexp(alltext,'(?<={...

Extract Data from .txt File

alltext = fileread('Datos_SSB_624_MHz_7_dB.txt'); % extract data between {"peakEvm": and }, allmatches = regexp(alltext,'(?<={...

1 year ago | 1

| accepted

Answered

How do I make numbers shift left using function?

@Amy Joyce Valencia I think this will work for you function Output = MyShiftLeft(y,x) for j=1:x temp=y(1); % shift v...

How do I make numbers shift left using function?

@Amy Joyce Valencia I think this will work for you function Output = MyShiftLeft(y,x) for j=1:x temp=y(1); % shift v...

1 year ago | 0

| accepted

Answered

Why isn't my matrix being filled?

@Coby Juarez Its because you are using old values of I S W but you are not updating them in loop. Please have a look at below ...

Why isn't my matrix being filled?

@Coby Juarez Its because you are using old values of I S W but you are not updating them in loop. Please have a look at below ...

1 year ago | 0

Answered

Matlab script "sample time period" error when calling Simulink model

Because 'test_lau/INES0' this block sample time (0.01) is lower than model sample time. It sould be multiple of the fixed step ...

Matlab script "sample time period" error when calling Simulink model

Because 'test_lau/INES0' this block sample time (0.01) is lower than model sample time. It sould be multiple of the fixed step ...

1 year ago | 1

| accepted

Answered

comparing datetime objects between two tables.

date1 = datetime('today'); date2 = datetime('yesterday'); date3 = datetime('tomorrow'); date4 = datetime('tomorrow'); date...

comparing datetime objects between two tables.

date1 = datetime('today'); date2 = datetime('yesterday'); date3 = datetime('tomorrow'); date4 = datetime('tomorrow'); date...

1 year ago | 0

Answered

How do I add values to specific values/ specific place of an already existing array?

@Goncalo Costa will this work for you? t = [1.5, 2.5 ,3.5, 4.5, 5.5 ,6.5, 7.5, 8.5, 9.5, 10.5] A = [3.5, 5.5, 7.5] x = 2 req...

How do I add values to specific values/ specific place of an already existing array?

@Goncalo Costa will this work for you? t = [1.5, 2.5 ,3.5, 4.5, 5.5 ,6.5, 7.5, 8.5, 9.5, 10.5] A = [3.5, 5.5, 7.5] x = 2 req...

1 year ago | 0

Answered

Simulink SimulationOutput aaccess via Code

load_system('sampleModel'); [T] = sim('sampleModel'); T T.simout1 T.simout1.Data

Simulink SimulationOutput aaccess via Code

load_system('sampleModel'); [T] = sim('sampleModel'); T T.simout1 T.simout1.Data

1 year ago | 0

Answered

Suppose I have a 2 by 60 matrix, like A = [1:60,2:61] how can I reshape it by the first 10 rows so that I can get a 20 by 6 matrix??

A = [1:60;2:61] B = reshape(A,[20,6])

Suppose I have a 2 by 60 matrix, like A = [1:60,2:61] how can I reshape it by the first 10 rows so that I can get a 20 by 6 matrix??

A = [1:60;2:61] B = reshape(A,[20,6])

1 year ago | 1

| accepted

Answered

Names of connected outputs to inports of selected subsystem

@Ewelina Cholodowicz I hope this will solve your issue :) Please let me know if you stuck at any point, or any point is not cle...

Names of connected outputs to inports of selected subsystem

@Ewelina Cholodowicz I hope this will solve your issue :) Please let me know if you stuck at any point, or any point is not cle...

1 year ago | 0

| accepted

Answered

I am trying to make a zeros matrix where certain places is replaced by a 1

b=zeros(3,8); r = [1 1 3]; % row c = [1 8 4]; % column idx = sub2ind(size(b),r,c); b(idx) = 1; b

I am trying to make a zeros matrix where certain places is replaced by a 1

b=zeros(3,8); r = [1 1 3]; % row c = [1 8 4]; % column idx = sub2ind(size(b),r,c); b(idx) = 1; b

1 year ago | 0

| accepted

Answered

Required array is dependent on other arrays

ID_A = [];ID_B = [];ID_C = [];ID_D = []; ID_F = []; for x = 1:size(Scores,1) if OG(x)>90 ID_A(end+1) = ID(x); e...

Required array is dependent on other arrays

ID_A = [];ID_B = [];ID_C = [];ID_D = []; ID_F = []; for x = 1:size(Scores,1) if OG(x)>90 ID_A(end+1) = ID(x); e...

1 year ago | 0

| accepted

Answered

Reading a text file, skip the intermediate text lines and store the numeric numbers

fid = fopen('abc.txt'); tline = fgetl(fid); storedData ={}; while ischar(tline) if isstrprop(strtrim(tline(1)),'digit') ...

Reading a text file, skip the intermediate text lines and store the numeric numbers

fid = fopen('abc.txt'); tline = fgetl(fid); storedData ={}; while ischar(tline) if isstrprop(strtrim(tline(1)),'digit') ...

1 year ago | 0

| accepted

Answered

Displaying unreal numbers in system of equations

syms K eqn =(981 - 250*(K + (3^(1/2)*5^(1/2)*(400*K^2 + 981)^(1/2))/50)^2)^(1/2)/20; sol = vpasolve(eqn,K); sol1 = vpasolve(K...

Displaying unreal numbers in system of equations

syms K eqn =(981 - 250*(K + (3^(1/2)*5^(1/2)*(400*K^2 + 981)^(1/2))/50)^2)^(1/2)/20; sol = vpasolve(eqn,K); sol1 = vpasolve(K...

1 year ago | 0

Answered

Unable to edit table in my Report

Hello @Eric Aguado It was happening because you table ype was different. you need to create mlreportgen.dom.table caldataNew =...

Unable to edit table in my Report

Hello @Eric Aguado It was happening because you table ype was different. you need to create mlreportgen.dom.table caldataNew =...

1 year ago | 0

| accepted

Answered

help with matrix concatenation

@James Kamwela is this what you expect as answer please check main =[1 2 ; 3 4]; main = 1 2 3 4 Allmatr...

help with matrix concatenation

@James Kamwela is this what you expect as answer please check main =[1 2 ; 3 4]; main = 1 2 3 4 Allmatr...

1 year ago | 1

| accepted

Answered

Add next and previous business date of each date in array row

@chiefjia will this work? % Create array EventsArray = [datetime('today') datetime('yesterday') datetime('tomorrow')] newArra...

Add next and previous business date of each date in array row

@chiefjia will this work? % Create array EventsArray = [datetime('today') datetime('yesterday') datetime('tomorrow')] newArra...

1 year ago | 1

| accepted

Question

How to get Leftmost block position

I have a simulink Model. I want to find Left most position Block on first level.

1 year ago | 1 answer | 0

Answered

What should go in a next-generation MATLAB X?

An option to Show Inport name to left side instead of below. and Outport name to right side instead of below. To avoid this we...

What should go in a next-generation MATLAB X?

An option to Show Inport name to left side instead of below. and Outport name to right side instead of below. To avoid this we...

1 year ago | 0

Answered

How to set the nearest position of the block from the Simulink from Matlab script?

@Ewelina Cholodowicz I hope this will help you For doing this you need to extract position of ports (both inport and outport) ...

How to set the nearest position of the block from the Simulink from Matlab script?

@Ewelina Cholodowicz I hope this will help you For doing this you need to extract position of ports (both inport and outport) ...

1 year ago | 0

| accepted

Answered

hey. I keep getting an error for this code. If anyone could help me it would be greatly appreciated.

It was because value of (1+lim(gs)) was a=(1+lim(gs)) a = [55/54, 11/9] clear; clc; a = [1,12]; ...

hey. I keep getting an error for this code. If anyone could help me it would be greatly appreciated.

It was because value of (1+lim(gs)) was a=(1+lim(gs)) a = [55/54, 11/9] clear; clc; a = [1,12]; ...

1 year ago | 0

| accepted

Answered

Remove table columns that contain any 'Inf' value

modified = stock_returnsTable{:,:} output = modified(:, all(~isinf(modified), 1)) stock_returnsTable = 5×4 table ...

Remove table columns that contain any 'Inf' value

modified = stock_returnsTable{:,:} output = modified(:, all(~isinf(modified), 1)) stock_returnsTable = 5×4 table ...

1 year ago | 0

Answered

Assign multiple values to a cell

@Riccardo Tronconi Here you Go ! P=[1;2]; XY=[2,5; 4 ,6]; C= [P(:,:) XY(:,:)] %OR C=arrayfun(@(x) [P(x,:) XY(x,:)],P,'Unif...

Assign multiple values to a cell

@Riccardo Tronconi Here you Go ! P=[1;2]; XY=[2,5; 4 ,6]; C= [P(:,:) XY(:,:)] %OR C=arrayfun(@(x) [P(x,:) XY(x,:)],P,'Unif...

1 year ago | 1

| accepted

Answered

Open Simulink Editor "Requirements Manager" App programmatically

You can refer this link https://in.mathworks.com/help/slrequirements/ref/rmi.html slvnvdemo_fuelsys_officereq; blk_with_req = ...

Open Simulink Editor "Requirements Manager" App programmatically

You can refer this link https://in.mathworks.com/help/slrequirements/ref/rmi.html slvnvdemo_fuelsys_officereq; blk_with_req = ...

1 year ago | 0

Answered

Unable to remove jc_0531 warning

move State_Five little down from Initital_State it will solve jc_0531.

Unable to remove jc_0531 warning

move State_Five little down from Initital_State it will solve jc_0531.

1 year ago | 0

| accepted