Beantwortet
Raw EEG in .pdf, processing first step
You can read edf using function from file exchange <http://www.mathworks.com/matlabcentral/fileexchange/31900-edfread> or ...

fast 11 Jahre vor | 0

Beantwortet
want ideas for contour, z is not a function for x,y
Yes. Just use contour(X,Y,Z)

fast 11 Jahre vor | 0

Beantwortet
I've got a matrix with 4 columns and I want to insert a fifth one and I want it to have either -1,1 or 0 depending on the results of the subtraction of the values from my colums 3 and 2.
x(:,end+1) = double(-(x(:,4) < 0)) + double(x(:,4) > 0); Because the - converts from logical to double, you do not need the...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
ignoring the negative values....
cumsum(a(a > 0))

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
Problem with "change directory" in a for loop
Using cd just to read data is error prone. Because you have to ensure that after cd to change back to your original dir, otherwi...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
how to plot 3d pyramid ?
P = [pt1; pt2; pt3; pt4; pt5] ind = [1 2 5]; patch(P(ind, 1), P(ind, 2), P(ind, 3), 'r') hold on ind = [2 3 5]; patch...

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
The matlab code doesn't work?
What is the purpose of the for loop? It computes for 11 values of k (from -5 to 5) different x. But nothing is done with the x a...

fast 11 Jahre vor | 0

Beantwortet
ECG, difference between original data and imported data of original data into Matlab
The default format do display numbers in Matlab is short, i.e., "Scaled fixed point format with 5 digits.". If you want to see m...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Reading numeric values from complex text files
You can process individual lines using s = fgets(fid); data(i,:) = sscanf(s, '%f (%fdB, %f)');

fast 11 Jahre vor | 1

Beantwortet
How can I find the starting index number when my numbers are changing through a column vector?
Your question is somewhat unclear to me. What do you mean by starting index? If you have a vector in Matlab, the starting index ...

fast 11 Jahre vor | 0

Beantwortet
I am getting some error in matrix multiplication. Kindly help me in this regard.
If y is of size 240x1, than the result of (transpose(A)*A)\transpose(A)*y will be of the same size. You cannot assign a vector t...

fast 11 Jahre vor | 0

Beantwortet
how to initialise a struct array with pairs?
Initialise data(1).name = {'TJ', 'Tom Jones'}; data(2).name = {'JS', 'John Smith'}; Get entries data(1).n...

fast 11 Jahre vor | 1

Beantwortet
How can I solve the problem 'Subscripted assignment dimension mismatch' in my looping progress?
The error seems to be due to the first two arguemnts. Try [a,b,itr(i),irec(i),dt,offset,sdepth,selev,relev(i),... ...

fast 11 Jahre vor | 0

Beantwortet
Why does circle transform into a elipse when i plot a line and a circle ?
axis equal

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to deal with white spaces?
if strcmp(action1, 'OPEN DOOR') display('stuff goes here') end

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to do the following in one line?
data = data(data>xmin & data<xmax);

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
i am trying to save .mat file but its not working.
You evaluate the string save D:\F2\A240_50_1 Best_mat; That is, you try to save the variable 'Best_mat' to the file A240...

fast 11 Jahre vor | 0

Beantwortet
write an m-file using while loop which calculates the sum of elements within the following vector x=[5 2 -9 10 -1 9 -1] until a number greater than 8 is met? please help i have tried and i am confused on how to do this.
x=[5 2 -9 10 -1 9 -1]; partialsum = 0; i = 1; while partialsum <= 8 partialsum = partialsum + x(i); i = i ...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
How to expand a summation with different indexes
sum(diff(f(1:4)).*n(1:3).*arrayfun(@(x) sum(m(x:end)), 3:5))

fast 11 Jahre vor | 1

Beantwortet
Find groups of 1's in array
Nsplit = 5; % number of consecutive zeros that split a group Z = find(diff(x) == 1) - find(diff(x) == -1); Ngroups = sum(Z ...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Arrange Matrix - Each Column Values to a new row
You can transpose cells in Matlab: destData = destData';

fast 11 Jahre vor | 0

Beantwortet
How to multiply with a factor with time series data
CN = [68, 78, 90, 90, 78]; S = 1000./CN - 10;

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Nested if conditions to compute flow
Does this work for you? idx = Rainfall > 0.2; Runoff(idx) = 1000/CN(idx) - 10; Runoff(~idx) = (Rainfall(~idx) - 0.2 * (1...

fast 11 Jahre vor | 0

Beantwortet
Unique Permutation: with logical Elements OR with vectors which should at the end stand as one dimension (after each other) in a 2-dim-Matrix
This generates your example; you may generate the other matrices accordingly. N = 3; m = logical(fliplr(eye(N))) m1 = re...

fast 11 Jahre vor | 1

Beantwortet
When a function is invoked, how do you supress the "ans = ... " output? I have a semicolon on every single line in the function and yet I still get the "ans" output!
If you define a function to return something, and call it from the command line like >> myfun(23) it will return an an...

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
How I solve this equation (delta function)
In this formula m is not a 1x256 matrix, but a function that you can define as, e.g., gamma = 2.3; N = 256; m = @(j) N*...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Why makehgtform creates 4x4 matrices? Why not 3x3?
Rotation and scaling transformation matrices only require three columns. But, in order to do translation, the matrices need to h...

fast 11 Jahre vor | 1

Beantwortet
If else condition for the rainfall
You didn't mention what went wrong; the following code should work for you: Rainfall = rand(1,10); % fake some data CN = 2...

fast 11 Jahre vor | 0

Beantwortet
find '1' in an array
It is not entirely clear what you want to achieve; if you just want to get rid of the 0's, use x = [1 1 1 0 1 0 1 1 1 0 1 0 ...

fast 11 Jahre vor | 0

Beantwortet
loop/cycle for producing the following sequence of numbers A={1, 4, 5, 8, 9, ....} and/or B={2, 3, 6, 7, 10,....}
idx = repmat([1 1 0 0], 1, 3) idx = idx(2:end-1); X=[0 0 0 0 0], Y =[-1 -1 -1 -1 -1] Z(idx == 0) = X; Z(idx == 1) = ...

fast 11 Jahre vor | 0

Mehr laden