Risposto
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) = ...

quasi 13 anni fa | 0

Risposto
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...

quasi 13 anni fa | 0

Risposto
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...

quasi 13 anni fa | 0

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

quasi 13 anni fa | 0

Risposto
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...

circa 13 anni fa | 0

Risposto
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 ... ...

circa 13 anni fa | 0

| accettato

Risposto
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 ...

circa 13 anni fa | 0

Risposto
"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. ...

circa 13 anni fa | 0

Risposto
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...

circa 13 anni fa | 0

Risposto
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) ...

circa 13 anni fa | 0

| accettato

Risposto
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...

circa 13 anni fa | 1

Risposto
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{...

circa 13 anni fa | 0

| accettato

Risposto
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...

circa 13 anni fa | 0

Risposto
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...

circa 13 anni fa | 1

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

circa 13 anni fa | 0

Risposto
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 ...

circa 13 anni fa | 0

Risposto
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);...

circa 13 anni fa | 1

| accettato

Risposto
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...

circa 13 anni fa | 0

| accettato

Risposto
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...

circa 13 anni fa | 1

| accettato

Risposto
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));

circa 13 anni fa | 0

Risposto
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...

circa 13 anni fa | 1

Risposto
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.

circa 13 anni fa | 0

| accettato

Domanda


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, ...

circa 13 anni fa | 1 risposta | 0

1

risposta

Risposto
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 ...

circa 13 anni fa | 0

| accettato

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

circa 13 anni fa | 2

| accettato

Risposto
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...

circa 13 anni fa | 0

Risposto
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...

circa 13 anni fa | 0

| accettato

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

circa 13 anni fa | 0

Risposto
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...

circa 13 anni fa | 0

Risposto
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...

circa 13 anni fa | 2

Carica altro