I want to create a text file like this with Matlab but i don't know how should I do that.
range(0,25e-9,0+600e-9),range(0+600e-9,1e-4,1.000000e-03),range(1.000000e-03,25e-9,1.000000e-03+600e-9),range(1.000000e-03+600e-9,1e-4,2.000000e-03),range(2.000000e-03,25e-9,2.000000e-03+600e-9),range(2.000000e-03+600e-9,1e-4,3.000000e-03)
for example here I want to create 6 point and I can do it by myself. But if I want create 100 point or 500 point I have to use Matlab. I wrote a code and create a matrix something like this but what I want is different. It's my code but I cant use it.....
clc
clear
close all
stp1=25e-9;
stp2=1e-4;
A=600e-9;
B=1e-3;
i=3;
F=zeros(i,3);
for i=1:i
if i==1
F(i,1)=0;
F(i,2)=stp1;
F(i,3)=A;
else
if mod(i,2)==0
F(i,1)=F(i-1,3);
F(i,2)=stp2;
F(i,3)=(i/2)*B;
else
F(i,1)=F(i-1,3);
F(i,2)=stp1;
F(i,3)=F(i,1)+A;
end
end
end
for example this is my matrix:
` 0.0000e+000 25.0000e-009 600.0000e-009
600.0000e-009 100.0000e-006 1.0000e-003
1.0000e-003 25.0000e-009 1.0006e-003`
I want to put them in one line and this like this:
`range(0.0000e+000,25.0000e-009,600.0000e-009),range(600.0000e-009,100.0000e-006,1.0000e-003),range(1.0000e-003,25.0000e-009,1.0006e-003)`
you know I want to add range(A(1,1),A(1,2),A(1,3)),range(A(2,1),A(2,2),A(2,3)) to my text file.... I hope I have explained well that I want.
fprintfanddlmwrite? What have you tried to write to a text file?range(0,25e-9,0+600e-9),range(0+600e-9,1e-4,1.000000e-03),I can create a [i,3] matrix but i don't know how to put them in a text file likerange(0,25e-9,0+600e-9),range(0+600e-9,1e-4,1.000000e-03),.... I don't know how to explain.... sorry :(m x nmatrixA. (1) As @Hoki asked, do you know how to create your matrix? (2) You're wanting to write a text file from MATLAB that has matrixA, right? Is there a reasondlmwriteorfprintfaren't good approaches? (3) What have you tried so far (to write a text file)?cell-arraybut I didn't see any cell arrays in your code. Can you explain why this tag applies?