I need to copy Channel field data from a specific data range (e.g. January 2024) from field 6 of channel A(see sample attached) to field 1 of channel B. I have tried to adopt the Template "Get data from private channel" in the Matlab analysis area of Thingspeak. The last data can be copied according the sample, but I cannot manage to copy the complete datarange. My channel field contains half empty data in field 6, because I have posted data asynchrously from 2 devices to 1 channel up to now. Any advice for proper Matlab code sample or the like is welcome! Need to copy Channel field data from a specific data range (e.g. January 2024) from field 6 of channel A to field 1 of channel B Can you put your code inline or try the attachment again? It did not come through. Attached the source channel data extract and the adopted basic script for coping the last data only. Any modification to copy complete datarange (e.g. January data) from source to target channel very welcome! Thanks in advance! Have a look at the documentation for thingSpeakRead. You can specify the number of days to read with numdays or if you have more then 8000 points to read, you might want to use daterange input argument in order to specify the range of interest. thingSpeakRead(12397,NumDays=2); Thanks for prompt reply! I already passed the documentation for thingSpeakRead and thingSpeakWrite: Obviously there is no problem reading the January array from below thingSpeakRead command. But the thingSpeakWrite end in : "Error using Copy Data from one channel to another Second input must be either a named parameter or data specified as numeric scalars or arrays or cell arrays or tables." Can you help me to adapt the thingSpeakWrite command to write the January Data Array in the writeChannelID ? %% Read Data %% readField = 6; % Specify the field to read [data,timestamps,channelInfo] = thingSpeakRead(readChannelID, 'Fields', readField, 'ReadKey', readAPIKey, DateRange=[datetime(2024,1,1,00,00,01),datetime(2024,1,31,23,59,52)]); %% Write Data %% writeField = 1; % Specify the field to write % Write the table to the new channel thingSpeakWrite(writeChannelID, data, 'TimeStamp', timestamps, 'Fields', writeField, 'WriteKey', writeAPIKey); I was able to read and write data with similar code. %% Read Data %% readField = 2; % Specify the field to read [data,timestamps,channelInfo] = thingSpeakRead(12397, 'Fields', readField,numminutes=2); %% Write Data %% writeField = 1; % Specify the field to write % Write the table to the new channel thingSpeakWrite(nnn, data, 'TimeStamp', timestamps, 'Fields', writeField, 'WriteKey', 'xxx'); The issue comes when you read a field with no data in it. When I read a channel that has no data in the time period specified, I got the error you did. I would inspect data to make sure its not empty, for example like this if size(data,1)>0 %do the thingSpeak write end If you still want to write to the new channel even if 'readfield' has empty data, than dont specify the field number in the thingSpeakread command and you will get an array of data with all fields. But then you will get timestamps for the empty data (assuming there is data in some field). Then you can write the empty data using the timestamps and nulls or zeros() function to create empty data. Programming in ThingSpeak can be harder without a MATLAB license. You can inspect vatiables by leaving the semicolon off for example just adding the line data to your code will allow you to inspect it. You can also access MATLAB intepreters at MATLAB online and at the MATLAB AI chat playground (on the right hand side.) These will help you write your MATLAB code for ThingSpeak, and you can even ask the AI for help too if you wish. copy fields