Beantwortet
When I run this program it shows erron in line 4.
use 'mod' function in the for loop. n = input("ENTER A NUMBER "); flag = 0 ; for i=1:n if (mod(n,i)==0) fla...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
i have a list of data and i have to select first 5th column of each row ..then simultaneously 6th column and 7th column
I have changed your variable from categorical to cell arrray. T = table({'karan';'varun';'ravina'},[25;45;12],... {'Surger...

fast 4 Jahre vor | 0

Beantwortet
How to store the output?
import java.math.*; a = BigInteger('12345678'); c = BigInteger('67436255757'); n = BigInteger('10'); for i=1:double(n) y = ...

fast 4 Jahre vor | 0

Beantwortet
How can I delete certain rows of a matrix based on the first time one column is different from zero
try this: M=randi([1 700],10,13); % generating random matrix with 10 rows and 13 column M(:,8)=[2;5;7;1;6;7;1;4;6;1]; % forcel...

fast 4 Jahre vor | 0

Beantwortet
How to use 1 column and all rows from a matrix in each iteration?
A=randi(100,7,127); % genrating random matrix C=cell(1,size(A,2)); for i=1:size(A,2) C{i}=A(:,i);% in each iteration all ...

fast 4 Jahre vor | 1

Beantwortet
Stacking diagonal matrices generated from rows of other matrix
2nd to 4th diagonal of C C=magic(4) C1=tril(C,-1); C2=triu(C1,-1)

fast 4 Jahre vor | 0

Beantwortet
For repeating values in a column calculate the corresponding adjacent columns
A=[1 233 456;2 3434 565; 3 4545 2323; 4 4595 595; 4 121 343; 5 1212 4145]; % assume A is table B=diff(A(:,1)); [idx]=find(B==0...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Obtain the sorted index vector
x=[0.5; 0.4; 0.6; 0.9]; y=sort(x,'descend'); [Lia,Locb] = ismember(y,x); z=Locb' % if want as a column vector out=Locb(:)

fast 4 Jahre vor | 0

Beantwortet
How can i generate data randomly in MATLAB
try this: VALUE=1:(1000-1)/31:1000 out2 = repmat(VALUE,1,ceil(4000/numel(VALUE))); scatter(1:length(out2),out2);

fast 4 Jahre vor | 0

Beantwortet
Bringing arrays to the same length
try this: a=[ 1.2,1.3,1.4]; % by array "a" i need to sort the values in array "b" and "m" b=[ 1.2,0.9,1.3,2.6,1.4]; m=[1,2;26...

fast 4 Jahre vor | 0

Beantwortet
I want to put numbers from 1 to 8 after the file name using 'for loop' and save this file name as a variable.
try this: C=cell(8,2); j = 1; for m = [1:8] C{m,1}=strcat('fn','_',num2str(j)); C{m,2}=strcat('file name',num2str(j...

fast 4 Jahre vor | 0

Beantwortet
How can i divide the data in rows in MATLAB
use reshape function A=load('newdata.mat'); dataset=A.dataset; output=reshape(dataset,16,[]);

fast 4 Jahre vor | 0

Beantwortet
plot figure title error
try this figure year=2003; mm=05; dd=01; title([ 'Date',': ', num2str(year),' / ' num2str(mm,'%.2d'),' / ', num2str(dd,'%.2...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
Error in implementation matrix dimension
Use element wise (./) division A = linspace(10,1000,100); reciprocalA = 1./A; check this also for dot expression https://www...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to make MATLAB compute values in vertical columns to copy easier?
may be you want to transpose "y". end of your code type this syntax output=y';

fast 4 Jahre vor | 0

Beantwortet
About "ismember" function
try this: var1={'AAA' 1;'AA' 2;'A' 3;'BBB' 5;'BB' 7;'B' 13}; var2={'B' 2 3 5;'A' 4 6 8;'BB' 6 7 1;'B' 2 1 6;'A' 2 8 1;'AA' ...

fast 4 Jahre vor | 0

Beantwortet
How to correct the code?
you are comparing [Eg(:,n)>=cons] with an array where Eg(:,n) neither greater nor smaller. see in index 2 of Eg, 5.2519 > 0.5...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
I am trying to find the roots of this equation but my code doesn't work. It keeps saying theta0 is unrecognized,
save your function. you have to define your variable theta0 in this function. function y = f(x) y0= 2; yf= 1; v0=20; theta=...

fast 4 Jahre vor | 0

Beantwortet
Importing data from a text file (with ".txt" extension), data processing and export it to excel
I have export your text data into excel. then i work with this excel in matlab. [number,str,all]=xlsread('example.xlsx'); % ex...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
how could i plot a contour
you shoud demontrate element wise multiplication/division in the variable z. most porbably this contour is allowed to plot real ...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
How can I delete 10% random Selected Index from array without changing shape in Matlab
try this: A=load('datasetvalue.mat'); AA=A.dataset ; N = numel(AA) ; % total number of elements tenpercent=round(10/100*N)...

fast 4 Jahre vor | 1

Beantwortet
How to create a Line Plot from gauge Data?
try this: time=table2array(RightHead2(2:end,1)); waveAmp=table2array(RightHead2(2:end,2)); plot(time,waveAmp) or simply wav...

fast 4 Jahre vor | 0

Beantwortet
How to add a legend entry for labels
you did not attach your data here. I have taken a simple plot example here. you can just rename in the legend function whatever ...

fast 4 Jahre vor | 0

Beantwortet
I want to change cell array to string.
try this: A=[{'abc = 1'},{'def = 2'},{'cba = 3'},{'fed = 4'},{'sag = 5'},{'dfg = 6'}]; str=string(A)'; fprintf('\n%s\n',str);...

fast 4 Jahre vor | 0

Beantwortet
Make first and last element of array 0
try this: N = 12*0.5; TAU_max = 15; for i = 1:N TAU(i,:) = i*(TAU_max/N); TAU([1 N],:)=0; end disp(TAU)

fast 4 Jahre vor | 0

Beantwortet
sin graph plot in reverse time
i think you don't need a loop here t=100:-1:1; y=sin(t); plot(t,y)

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
searching first two consecutive ones and set to 0
try this: y=[1 1 1 1 1 1 1 1 1 1 1]; idx=y(1:2); b=find(y(idx)); if y(b)==1 y(b)=0; end disp(y)

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
storing test file here
if you are following this question you can try this code https://www.mathworks.com/matlabcentral/answers/1657230-how-can-i-find...

etwa 4 Jahre vor | 0

Beantwortet
How to find average and standard deviation in a for loop?
you can store your data in a cell array. just export the date in excel using range. and you are indexing upto k=14. but you have...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to find intersection between row and column from Excel file
A=readtable('Book6.xlsx','ReadVariableNames',false); AA=table2array(A); nrows = 11; ncols = 11; for c = 1:ncols for r =...

etwa 4 Jahre vor | 0

Mehr laden