Risposto
Finding a value of one vector based on the nonzero values of another vector
A = [2 5 1 4]; B = [0 1 0 1]; [I C]=find(B==1); output=A(C)

circa 2 mesi fa | 0

Risposto
[Ask Help] - Convert Negative Commas Decimal into Single Binary
data = [1.295175 -0.021158 -0.274017]; data(data<0)=0; data(data>1)=1

circa 2 mesi fa | 0

| accettato

Risposto
Black Jack input and output
try this: a=[9 13]; output_1=check_possibilities(a) b=[23 34]; output_2=check_possibilities(b) c=[9 20 19 22]; output_3=ch...

circa 2 mesi fa | 0

Risposto
MATLAB maximum value under a certain value
a=[ 23, 19, 12,18,30,17,20,28,21,65,22,31]; b=a(a>=17 & a<=21) % elements between greater equal 17 and smaller equal 21 maxi...

circa 2 mesi fa | 0

| accettato

Risposto
I am having this error, could you help?
try this: a=1.6; b=0; % x(1)=1.28; % x(2)=1.36; % x(3)=2.47; % x(4)=3.68; % x(5)=4.56; x=[1.28;1.36;2.47;3.68;4.56];...

circa 2 mesi fa | 0

Risposto
How to save the output of each loop in .csv file?
if your "result " is in matrix form, then try this result=randi(100,100,20); % making text files for j=1:size(result,2) col=...

circa 2 mesi fa | 1

Risposto
how to extract subset from dataset?

circa 2 mesi fa | 0

| accettato

Risposto
drawing a point in the graph
x = 1:5; y = 20:24; plot(x,y,x(3),y(3),'*') % specify a marker symbol * in index 3 of y please follow this for more informati...

circa 2 mesi fa | 0

Risposto
Plot 2 columns in matrix depend on another column
Data=[ 20 10 80 805 82.1420812600000 20 10 80 815 82.5962426700000 20 10 80 825 83.0389831800000 20 10 80 835 83.46999082000...

circa 2 mesi fa | 0

| accettato

Risposto
Vertcat, I think I need to have consistent rows and columns, erroring out on B matrix creation. Can anyone show me how to make this correct?
try this: a=3; b=13; c=0; rG2a=a/2; rG3a=b/2; omega2=2000*2*pi/60; %rad/s alpha2=0; W2=1; W3=.5; W4=.2; I2=.002; I3=...

2 mesi fa | 1

Risposto
How do I substract like variables from each other
one approach: a=readmatrix("Book1.xlsx"); b= datetime(a,'ConvertFrom','excel'); % b(:,3)=b(:,2); for i=1:size(b,1)-1 if...

2 mesi fa | 0

Risposto

2 mesi fa | 0

Risposto
how to remove empty cells from a cell array
a=load("cellArray.mat"); A=a.I; checkemptycell = any(~cellfun('isempty',A), 1); output = A(:,checkemptycell)

2 mesi fa | 0

Risposto
How to copy each column to other file faster?

2 mesi fa | 0

| accettato

Risposto
Rounding down when doing division in Matlab
use ceil function: a=ceil(1/7) b=ceil(2/7) c=ceil(7/7) d=ceil(8/7)

2 mesi fa | 0

| accettato

Risposto
code that would identify the identical rows

3 mesi fa | 0

| accettato

Risposto
delete some matrix values
A = [1 2 3 4 5 6 7 8 9]; B=A(A<7)

3 mesi fa | 0

| accettato

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

3 mesi fa | 0

| accettato

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

3 mesi fa | 0

Risposto
how to import data from csv and plot?

3 mesi fa | 1

| accettato

Risposto
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

3 mesi fa | 0

| accettato

Domanda

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

3 mesi fa | 1 risposta | 0

### 1

risposta

Domanda

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]'; ...

3 mesi fa | 2 risposte | 0

### 2

risposte

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

3 mesi fa | 0

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

3 mesi fa | 0

| accettato

Domanda

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

4 mesi fa | 2 risposte | 0

### 2

risposte

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

5 mesi fa | 0

Domanda

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

5 mesi fa | 4 risposte | 0

### 4

risposte

Domanda

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

7 mesi fa | 0 risposte | 0

### 0

risposte

Risposto
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'); ...

10 mesi fa | 0

| accettato