Réponse apportée
delete some matrix values
A = [1 2 3 4 5 6 7 8 9]; B=A(A<7)

environ 3 ans il y a | 0

| A accepté

Réponse apportée
remove NaN from 1xn Matrix
A = [0 3 2 4 1 NaN 3 2 NaN 2 4 2 1 3 NaN 2 4 2]; B = A(~isnan(A)) Hint: https://www.mathworks.com/matlabcentral/answers/17914...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
What Am I Missing? Newbie to MATLAB and not sure what to do.
Variable R is a row vector of 4 elements. But you defined indices up to 5. That's why you are getting an error. V=zeros(4,5); ...

environ 3 ans il y a | 0

Réponse apportée
how to import data from csv and plot?
A=readtable('baseline.csv','VariableNamingRule','preserve'); xaxis=table2array(A(:,1)); datavalue=table2array(A(:,2)); C=cate...

environ 3 ans il y a | 1

| A accepté

Réponse apportée
matrix 1xn MatLab
a = [0 0 0 0 0 0 0 0 0 0]; b = [1 2 3]; a(1:length(b))=b; c=a

environ 3 ans il y a | 0

| A accepté

Question


What are these blocks in the model power_3phseriescomp?
I am trying to design a Simulink model on 3 phase grid system. I have found this model in Mathworks. But I am confused about som...

environ 3 ans il y a | 1 réponse | 0

1

réponse

Question


How to vectorize ?
according to my vectorization the output should be = [0 ; 1 ; 0 ; 1 ; 0; 1]. What am I missing ? a=[600 300 510 250 700 300]'; ...

plus de 3 ans il y a | 2 réponses | 0

2

réponses

Réponse apportée
How do I import multiple CSV files from a directory as tables in the workspace?
Try this: % Get a list of all files in the folder with the desired file name pattern. myFolder='\\msint82\redirect$\4136\Deskt...

plus de 3 ans il y a | 0

Réponse apportée
Matrix Reshaping 9x9 to 3x27
A=[8 1 4 7 9 1 2 4 9 6 1 2 7 1 4 8 1 5 5 5 8 5 ...

plus de 3 ans il y a | 0

| A accepté

Question


How to use cumsum function?
not able to get the expected output. if col5<200 then, col5+25 and the result will be replaced in next row of col5 untill col...

plus de 3 ans il y a | 2 réponses | 0

2

réponses

Réponse apportée
How to subtract ?
At last got the solution !!!! a=load("allmat.mat"); allmat=a.allmat; for i=1:size(allmat,1) allmat(i,11)=allmat(i,6)-all...

plus de 3 ans il y a | 0

Question


How to subtract ?
Its just a simple subtraction function in excel. Even It seems very simple in matlab. Still hitting my brain, but .... A=[0 1 2...

plus de 3 ans il y a | 4 réponses | 0

4

réponses

Question


How to use Multiple MATLAB Licenses in the same Machine?
Current Machine Condition: Machine1(Desktop): installed only "MATLAB Parallel Server" tool (license no: for example 100001) M...

plus de 3 ans il y a | 1 réponse | 0

0

réponse

Réponse apportée
how to make a code that guess the color of the string variable stored ?
try this: mywords = "sulaman is here"; ht = text(0.8,0.8,mywords,'color','b'); A = input('whats my favourite color ? ','s'); ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Trouble using readtable function
you need to specify the file with single quotation. TGWAS = readtable('AD_magma_genes.txt')

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Convert matrix with 3 columns ([day month year]) into one string dd/mm/yyyy with each part taking value of one column
try this: A=[1 3 1981 28 3 1982 23 3 1983 9 5 1984 27 3 1985 15 2 1986 19 2 1987 16 4 1988 20 3 1989]; T=table(A(:,1),...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to find the closest value to the average in an array?
Then average will be 4.14, which is closest to 4. actually average is 4. you can try this: a=[1,2,3,4,6,6]; average=mean(a) ...

presque 4 ans il y a | 0

Réponse apportée
How to delete in a table a row which contains a specific word
try with this: A=readtable('andrea_file.csv','ReadVariableNames',false,'HeaderLines',3); B=table2cell(A); C=string(B) [row c...

presque 4 ans il y a | 2

| A accepté

Réponse apportée
How to Create/Modify for matrices or matrix
try this: K=5 matA=1:K; % matB=[matA matA matA matA matA] % matB=[1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5] matB=r...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Getting the entry value (i,j) for the minimum value of reach row of a matrix
may be you are looking for this: A=[11 13 15 12 14 16 32 18 21]; mincol=min(A) % min value of eac...

presque 4 ans il y a | 1

Réponse apportée
How to delete in a table a row which contains a specific word
as you did not attach your file, i have attached my own created data A=readtable('myfile.xlsx','ReadVariableNames',false); B=t...

presque 4 ans il y a | 1

Réponse apportée
I have a cell array 1x7 and every matrix contains 5844x4double and they're all same size. Now i need to extract data from each cell array and each matrixe(5844x4double ) and t
how can I attached the mat data? just right click on the mat file > save as > put any name. here I have tried to make a cell a...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Assigning Null / Multi-Dimensional Matrix
vectorized solution is the most efficient and simple. But, still if you need for loop, try this x=1:5; A = repmat(x,4,1); fo...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
changing similar numbers in a raw
try this: X=[1 2 2 2 3 2 4 2 2 2]; a=X(X==2); b=randperm(length(a)); a=b; X(X==2)=0; X(X==0)=a

presque 4 ans il y a | 0

Réponse apportée
how to plot the curve in matlab
A=[57 78.2 165.1 87 67.06 101.8 107 64.66 88.7 257 61.43 63.58 507 61.45 61.47 1007 60.51 60.91]; x=A(:,1); Y1=A(:,2...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Index exceeds the number of array error
var = randi(100,20,20); [val,idx] = max(var(:)) [x, y] = find(var == val) idx2=2; x0 = x(idx2) y0 = y(idx2) here your idx=...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
exporting a .mat file to csv/ xls
you have to extract your data from the struct. here i am giving an example. i have attached a struct structvalue=load('data2.ma...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How to name the sheet in excel using MATLAB
try this: writetable(T,'test.xlsx','FileType','spreadsheet','Sheet','a') % T is your output variable

presque 4 ans il y a | 2

| A accepté

Réponse apportée
How can we find the block name in simulink. actually i have one block but i dont know that block name how can i find from simulink library
Double click on that block. you can find the name on Block Parameters pop up window

presque 4 ans il y a | 0

Réponse apportée
multiplying matrix by a vector on an element by element basis using for loops
try this: A = [1 12 22 10 18; 20 8 13 2 25; 6 19 3 23 14; 4 24 17 15 7; 11 21 16 5 9]; B = [9 7 11 4 23]; for i = 1:size(A,1)...

presque 4 ans il y a | 0

Charger plus