Réponse apportée
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 ...

plus de 10 ans il y a | 0

Réponse apportée
want ideas for contour, z is not a function for x,y
Yes. Just use contour(X,Y,Z)

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
ignoring the negative values....
cumsum(a(a > 0))

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

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

plus de 10 ans il y a | 1

Réponse apportée
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 ...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 1

Réponse apportée
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),... ...

plus de 10 ans il y a | 0

Réponse apportée
Why does circle transform into a elipse when i plot a line and a circle ?
axis equal

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
How to deal with white spaces?
if strcmp(action1, 'OPEN DOOR') display('stuff goes here') end

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
How to do the following in one line?
data = data(data>xmin & data<xmax);

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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 ...

plus de 10 ans il y a | 0

| A accepté

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

plus de 10 ans il y a | 1

Réponse apportée
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 ...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
Arrange Matrix - Each Column Values to a new row
You can transpose cells in Matlab: destData = destData';

plus de 10 ans il y a | 0

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

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 1

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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*...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 1

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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 ...

plus de 10 ans il y a | 0

Réponse apportée
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) = ...

plus de 10 ans il y a | 0

Charger plus