MATLAB: How to Convert 3d matrix to row matrix?? 3d matrix I have a 3d matrix in the workspace variable named WT.dec{1,1}, I need it to be converted to single dimention row matrix. How can do this??? Best Answer A = rand(10,10,10);B = reshape(A,[1,1000]); Related SolutionsMATLAB: Reading Workspace variable into csv file The most important thing to do first is to reshape the data to a 2D array. Then we can use the writematrix function as normal.WT.dec{1,1}=rand(17,19,17);%generate random datad=WT.dec{1, 1};%store in other variable for shorter syntax%option 1: 17x323d1=reshape(d,size(d,1),[]);%option 2: 289x19d2=mat2cell(d,size(d,1),size(d,2),ones(1,size(d,3)));d2=cell2mat(d2(:));filename='d1.csv';writematrix(d1,filename) MATLAB: How to include text and variable in excel sheet name when using xlswrite Yes, use sprintf() to create a sheet name from your variables:sheetName = sprintf('%s %d', yourString, yourInteger);cellRef = 'D3'; % Whateverxlswrite(filename, yourData, sheetName, cellRef); Related QuestionRead and write text to matrix and write to ExcelImage Write in ExcelProgramatically change range of excel sheet depending on dataConcatenation of 3D Array into 2D Array
Best Answer