Answered
how to convert digital data into analog data using matlab code?
U=10; % range signal from 0 to 10 n=3 % number of bits q=U/(2^n-1) % quantization interval t=0:0.1:10; % your time vector ...

13 years ago | 5

| accepted

Answered
how to determine a period for sinewave
Example t=0:0.01:10; y=sin(t); [idx,idx]=findpeaks(y); T=t(idx(2))-t(idx(1)) % The periode T (sec)

13 years ago | 2

Answered
Reading all variable from a mat file.
How can you have multiple variables with the same name? one name, one variable a=10; a=20% will erase the first content of...

13 years ago | 0

Answered
Convert multiple csv to xls files.
yourfolder='E:\matlab' d=dir([yourfolder '\*.csv']); files={d.name}; for k=1:numel(files) old_name=files{k}; ...

13 years ago | 0

| accepted

Answered
palette and index changes
Palette=0:8; idx=1:numel(Palette); k=[1 2 3 4 5 6 7 8]; l=[4 8 1 1 1 1 4 4]; for ii=1:numel(k) a=Palette(k(ii)); ...

13 years ago | 0

Answered
Change workspace variable name
If you want to rename A to B B=A clear A

13 years ago | 1

| accepted

Answered
assign a veriable to the numbers from a a txt file
A=dlmread('file.txt')

13 years ago | 0

Answered
In an assignment A(I) = B, the number of elements in B and I must be the same. this is the error i am getting
You don't need a for loop for that rh=[200 300 400 400 900 1300 1350 1300 1000 700 650 350];

13 years ago | 1

| accepted

Answered
A function that separates an image into three two dimensional matrices, RGB
You have a typo error, you wrote Seperate_RGB_components(A) It should be Separate_RGB_components(A)

13 years ago | 0

| accepted

Answered
How to replace elements different than 0 and different than NaN to 1?
A(A~=0)=1 %or maybe you want idx=isnan(A) | A==0 A(~idx)=1

13 years ago | 1

Answered
Why is matlab not computing this correctly?
Why are you expecting 0.8308? the correct answer is -137.0354, you can find it with the for loop: v=[c9,c8,c7,c6,c5,c4,c3,c...

13 years ago | 0

Answered
help using surf command
Your data are latitude , longitude and pressure, it's obvious they should be the same size

13 years ago | 0

Answered
matlab: Sparse Function for any matrix
Why you don't use sparse function? B=sparse(A)

13 years ago | 0

Answered
how to expand cell array?
a=[sprintf('T1-00%d T2-00%d ',[1:9;1:9]) sprintf('T1-0%d T2-0%d ',[10:58;10:58]) ] out=regexp(a,'\w+\-\w+','match') out=resh...

13 years ago | 0

Answered
How to convert a code from C language to Matlab?
Look at <http://www.mathworks.com/help/matlab/matlab_external/introducing-mex-files.html mex files>

13 years ago | 0

Answered
Adding three cells element wise using cellfun
n=2; A{n}+B{n}+C{n} Is it what you are asking for? % or maybe you want this ii=5 out=cellfun(@(x,y,z) x(ii)+y(ii)+...

13 years ago | 0

Answered
Trouble reading .mat file
With 32 bits or 64 bits, you get the same mat file. Maybe your file is not completely downloaded or is really corrupt, try to do...

13 years ago | 0

Answered
How to construct this vector without loop?
A=[1 2 3 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9] cell2mat(arrayfun(@(x) 1:3*x,A,'un',0))

13 years ago | 0

Answered
Remove lines from logical matrix if values in 3 or more rows are equal to 1.
a = [0 0 0 0 0; 0 1 1 0 0; 1 1 0 1 1]; a(sum(a,2)>=3,:)=[]

13 years ago | 0

| accepted

Answered
control the size of the display
Look at this example t=0:0.1:10; y=sin(t); plot(t,y); set(gcf,'units','inches','position',[1 1 10 5])

13 years ago | 0

Answered
how to delete some unwanted data from a large nomber of data?
A=rand(10) %If you want to delete column [1 3 5] A(:,[1 3 5])=[]

13 years ago | 0

| accepted

Answered
cell2mat with 1* 1 cell array
Type A whos A what did you get?

13 years ago | 0

| accepted

Answered
How to make for loop ?
out=cell(9,4); for k=1:9 file=sprintf('database/ae/ae_0a0%d.wav') [signal,Fs,nbits,opts] = wavread(file) ou...

13 years ago | 0

Answered
How to add columns to cell array
[cells repmat({'-'},3,2)]

13 years ago | 1

| accepted

Answered
How do I product elements of a vector?
A = [71 2; 72 2; 73 2; 74 2; 75 2]; prod(A(2:4,2))

13 years ago | 0

Answered
append/save same variable with updated values without overwriting previous values.
stress=zeros(3,5); for k=1:3 stress(k,:)=[1 2 3 4 5]; % adapt this line to your problem end % There is another wa...

13 years ago | 0

Answered
my question is how to get the following format?
r=[ 1 2 3 4] matrix=repmat(r,3,1)

13 years ago | 0

| accepted

Answered
Delimit a vector by decimal
If you import your data as cell array of char A={'1.233';'22.330';'540.3001'} out=regexp(A,'\.','split') out=str2double(r...

13 years ago | 1

| accepted

Answered
Writing zero to text file
A=[1.23;52;14.356] fid=fopen('file.txt','w') fprintf(fid,'%.5f\n',A) fclose(fid)

13 years ago | 0

| accepted

Answered
Problem with symbolic math
syms x1 x2 x3 gr =[2*x1 + 2*x2;2*x1 + 4*x2 + 2*x3; 2*x2 + 4*x3] p1 =[957/2500;-293/1250;371/5000]; gr2=subs(gr,{x1,x2,x3},{...

13 years ago | 0

| accepted

Load more