Answered
Matlab While Loop problem
count = 0 while count < numel(a) count = count + 1; if a(count)>1 b(count) = log(a(count)); else b(count) = ...

10 years ago | 0

Answered
Transform a two dimensional into a three dimensional and combine with another three dimensional array
Repmat is an efficient method... A = randn(4,3); for i = 5:-1:1 B(:,:,5) = A; end B(:,end+(1:10),:) = zeros(4...

10 years ago | 0

Answered
I tried debugging the code it works until it reaches line 31 (temp=pad...) i dont know what i am doing wrong but can u help me with this error it is indicated after the code
Put a breakpoint in your code at line 31, and look in the memory of the function for a _variable_ called pad. I suspect that you...

10 years ago | 0

Answered
Basics of Audio Communication??
Soundwaves are converted to electrical signals by a microphone. In basic AM transmission, those electrical signals are added...

10 years ago | 0

Answered
how to compare multiple plots of filter by different colors in a same window?
Generic answer: t = 0:timestep:time_end; % supply your own "time" values x1 = sin(t); % output of filter 1 x2 = cos(4*pi...

11 years ago | 0

Answered
I have been getting this error and have had no luck resolving it. Any help please?
_(It follows the END that terminates the definition of the function "addwaves3".)_ Thats your major clue: function ... ...

11 years ago | 0

| accepted

Answered
Calculation of monthly returns
Your if statement condition looks hinky. "h+k<=j" is ALWAYS false, because you've coded h to ALWAYS be higher or equal to j ...

11 years ago | 0

Answered
"Work around" for using an index with decimal entries
Ok, looks like you have two "good" options. #1 Store the indices in an array of their own, of the same size as the data. ...

11 years ago | 0

Answered
Importating Data from Excell
third_col = xlsread(filename, sheet#, 'C:C')'; times = 0:5:((86000-1)*5); plot(times,third_col) The "n"th part of thir...

11 years ago | 0

Answered
peak addition/ arrary addition
If all the peaks have the same parameterised formula f = @(A,B,C,x)(A.*exp(-(1-x./B).^2./C); for i = 1:numel(x) y(i) ...

11 years ago | 0

| accepted

Answered
Draw a binary image
image_i_want = [1 1 0 0 1 1 0 0 1 1 1 0 0 0 ...put in the rest of your pattern... ]; imagesc(image_i_want) You probably wa...

11 years ago | 1

Answered
Importing multiple csv files, giving them new names and extracting different columns of data to form seperate datastrings
Importdir=dir('*.CSV') for i = 1:numel(Importdir); M = Importdir(i).name; M =csvimport (M); M_D{i} = M(:,3); M_U{...

11 years ago | 0

| accepted

Answered
Any method to restore garbled/distorted text file?
read the file as binary data, unsigned 8 bit integers. When you have an unknown symbol, or for some reason you expect a know...

11 years ago | 0

Answered
How to open a specific EXCEL sheet with the function _fopen_?
fopen opens files for binary or string access. An excel file is a binary file in a format that is not easily defined, so rea...

11 years ago | 1

Answered
savesas does not work as saveas in the menu
Try using gcf with saveas, not gca.

11 years ago | 0

Answered
How to "save as" a processed graph as a .txt data file?
csvwrite can write text files (csv delimited), save can write text files if you use the ascii flag. uiputfile is a function ...

11 years ago | 0

Answered
Is it possible to create multiple functions and calling them in one .m file?
Generically, this is the process: function whee = whatevs(a,b,c) %1st line of m file whee = alpha(a) + beta(b) + gamma(c);...

11 years ago | 1

| accepted

Answered
How to avoid overwriting in EXcel worksheet when program run next time?
Step 1: Check to see what has been written to the worksheet: [n t r] = xlsread(filename,sheetno); Step 2: Figure o...

11 years ago | 0

| accepted

Answered
How to save to mat file
Looks like you're trying to save a file to either, an open file (try "fclose all"), or a file location that you do not have perm...

11 years ago | 1

| accepted

Answered
Calculate standard deviation given frequency counts rather than sample
mu = (A(:,1).*A(:,2)) ./ sum(A(:,1)); std =sqrt(sum(A(:,1).*(A(:,2)-mu).^2)) ./(sum(A(:,1))-1));

11 years ago | 0

Answered
How to open data file by browsing it - MATLAB GUI
If you use: cd(filepath1); You shouldn't need to use "filepath1" again. opener1=load([filename1]); %reads matlab...

11 years ago | 1

Answered
find an ID that has two values for another variable
x0 = find(ID = ID(i) & (fyear == year(x00-1) | fyear==year(x00-7))) Note that | is "pipe", not capital i, or lowercase L.

11 years ago | 0

| accepted

Question


Invalid file properties returned by dir
So, I've been using dir to quickly get me a catalogue of all the file sizes of a specific type of file. My code works, however, ...

11 years ago | 1 answer | 0

1

answer

Answered
How to draw a perpendicular line to another?
xm0 = (x01+x02)/2; ym0 = (y01+y02)/2 m = (y2 - y1) / (x2-x1); PLm = tan( atan(m)+pi/2); PLc = ym0 - PLm*xm0; %PL line ...

11 years ago | 0

| accepted

Answered
find the nearest value
q = [1 3 6 8 10 15]; v = 9; [~,ans] = (min(abs(q - v)))

11 years ago | 2

| accepted

Answered
Two different ways to create a struct have 2 different results
I think it may be because structs are an alternative to cells and the chap who wrote the function thought it might make be sensi...

11 years ago | 0

Answered
Reading and loading variable file names
Sounds like you need a combination of reading filenames, and generating filenames: A = dir('D:\mydatahere\Wow*.mat'); A is...

11 years ago | 0

| accepted

Answered
how can I calc velocity and acceleration in matlab?
Velocity = (Position2 - Position1) * sample_rate (or divide by the difference in times) Acceleration = (Velocity2-Velocity1) ...

11 years ago | 0

Answered
how to read a dat file in matlab
Try opening the file in notepad, or some other basic text editor and look at the data. If its garbled data, its obviously i...

11 years ago | 0

Answered
applying chaos to a signal using matlab/simulink
A pseudorandom sequence is a chaotic signal. rand - This gives you a pseudorandom number with a top-hat distribution of valu...

11 years ago | 2

Load more