已回答
how to floor time for each hour?
A={'12-Dec-2021 09:09:04' '12-Dec-2021 09:24:04' '12-Dec-2021 09:39:04' '12-Dec-2021 09:54:04'}; B=datetime(A,'F...

2 years 前 | 0

已回答
Read Data from Text File as Matrix
a=readmatrix('1.txt'); X=a'

2 years 前 | 0

| 已接受

已回答
How to save output (Matrix) in excel files?
M: your Matrix X=your excel file name writematrix(M,'X.xls')

2 years 前 | 0

已回答
How to import variable names and specific data range (comma separated values) from a .txt file?
try this: A=readtable('Earth-Moon_sys_ephem_at_ast_epochs.txt','delimiter','tab'); B=table2cell(A(20,:)); parameter=split(B,'...

2 years 前 | 1

已回答
Please anyone can help to plot a graph, i didnt get a graph for the below program, it didnt showing any error, the output coming like a blank graph.
try this: cj1 = 4.5e-12; vs1 = -10; cj2 = 6.5e-12; vs2 = -2; vc = 0.65; num = cj1/cj2; den = (vc-vs2)/(vc-vs1); m = 0.0264...

2 years 前 | 0

已回答
Create txt file from each row of Matrix
A=randi(100,3,7500); writematrix(A(1,:),'myfile1.txt') writematrix(A(2,:),'myfile2.txt') writematrix(A(3,:),'myfile3.txt')

2 years 前 | 0

已回答
ismembertol: What am I doing wrong?
try this: x=readmatrix('x.txt'); Transparency = x(x>=0.9 | x<=0.8); [Lia,~] = ismembertol (x, Transparency,1e-16)

2 years 前 | 1

已回答
Get and interpolate missed daily data
A=(datetime(2030,1,1):datetime(2060,12,31))'; % generating normal date A1=datenum(A); C=readtable('missed data.xlsx'); D1=da...

2 years 前 | 0

已回答
How do i write this code for different timestep like this code is for 3600 and i want to use different timesteps like 1800,900,450
I have considered Yb=5 and Yp=8. nsteps = 12; t = zeros (nsteps,1); A = zeros (nsteps,1); B = zeros(nsteps, 1); P = zeros(n...

2 years 前 | 0

已回答
HOW CAN CREATE A MATRIX FROM A SINGLE ROW?
use reshape function. A=randi(100,1,12) output=reshape(A,3,4)

2 years 前 | 1

| 已接受

已回答
converting the time data into Datetime Format
try this syntax: th = datetime(A.TimeStamp,'InputFormat','dd.MM.yyyy HH:mm:ss.SSS','ConvertFrom','datenum');

2 years 前 | 1

| 已接受

已回答
Simplifying a code to one matrix
you can concatenate the matrix Mx and My either horizontally or vertically % if horizontal output=horzcat(Mx,My) % if vertica...

2 years 前 | 0

| 已接受

已回答
i need to count the number of switches between numbers ( the frequency)
one approach. might be some other nice way A=[1,0,1,0,1,0,1,0]; B=numel(diff(A))+1

2 years 前 | 1

已回答
datetime format issue?
datelimits = datetime({'20080401', '20080402'}, 'Format', 'yyyyMMdd')

2 years 前 | 0

已回答
Extract same row and columns of matrix
you can find your answer here https://www.mathworks.com/matlabcentral/answers/266736-how-can-i-find-same-values-in-an-array Re...

2 years 前 | 1

已回答
How to convert a string into row vector?
try this: a = 753; b= dec2bin(a) % b= '1011110001' format longG output=str2double(b)

2 years 前 | 1

已回答
how can i get different answers?
you can write this function function y=myfunction(L,t) a=L(:,1); b=L(:,2); c=L(:,3); y=(a./(b+c))*t; end then call this f...

2 years 前 | 0

| 已接受

已回答
How to split data of a .mat file into trainH trainY testH testY as shown in picture
My guess: 1st step: load your cmc.mat file in Variable A as a struct. 2nd step: extract your 4 variables from struct A. A=loa...

2 years 前 | 0

| 已接受

已回答
How to place values in a matrix with values from another matrix?
Year=[2018;2019;2020;2021;2022]; value1=[13;15;-76;-1;0]; table1=table2array(table(Year,value1)) Year2=[2018;2019;2020;2020;2...

2 years 前 | 0

已回答
Replace zeros with non-zero values from another array
output1=[71;0 ;74 ;75 ;85 ;0 ;88 ]; output2=[39242;32;8385 ;0;17854; 74 ;10499]; output1(output1==0)=output2(output1==0); out...

2 years 前 | 0

| 已接受

已回答
How to search a specific row and a column from a csv file that are associated with the date that was selected?
try this. please follow the dateformat whenever user put the date. I have attached a random csv file. data=readtable('VIX.csv',...

2 years 前 | 0

| 已接受

已回答
Transform table to another format
Headers = ["Fund1";"Fund2";"Fund3"]; Fund1 = [1;0.1;0.2]; Fund2 = [0.3;1;0.4]; Fund3 = [0.5;0.6;1]; correlData = table(Heade...

2 years 前 | 1

已回答
How to compare elements of a 2D array with other elements of the same array.
A=[1 2 3 ; 2 9 5; 4 1 8] [A1 C]=ismember(A(:),A); A2=sort(C); % sorting index A3=A(A2) % value of A those are identical

2 years 前 | 0

已回答
How to apply dec2bin on a string to get a single output?
a = '56515219790691171413109057904011688695424810155802929973526481321309856242040'; a1=cell2mat(split(a,' ')); a2=str2double...

2 years 前 | 1

| 已接受

已回答
Converting array to column matrix
use colon(:). each variable will be forced to be a column vector col_vector=Eflevel(:) if you want extract first 50 data(50*1)...

2 years 前 | 0

| 已接受

已回答
logical operation on matrix
A=[1 2 3;4 5 6; 4 5 2] B=rem(A,2) % returns the odd number output=A-B

2 years 前 | 0

| 已接受

已回答
Extract the last day of each month in daily data set
if your data is arranged properly it would be 10227 rows from 1990 to 2017. then try this N=1990:2017; for i=1:length(N) A(i,...

2 years 前 | 0

已回答
Finding rows where the first column values are equal
A=[13453 10359 9955 5257 5299 5258 5849 3644 5848 5397 7230 5396 17132 17130 17118 4767 4768 4770 8291 8292 8316 3191 319...

2 years 前 | 1

| 已接受

已回答
How to create this patterned matrix?
try this: x=[0,8,7,6,5,4,3,2,1]; A1=circshift(x,1); A2=circshift(x,2); A3=circshift(x,3); A4=circshift(x,4); A5=circshift(...

2 years 前 | 1

已回答
Find a word in a text file and read values from that line
A=readtable('example2.txt','delimiter',':'); output=table2array(A(4,2))

2 years 前 | 0

加载更多