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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 1

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 1

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 1

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 1

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 1

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 1

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

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

más de 10 años hace | 1

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

más de 10 años hace | 1

| aceptada

Respondida
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*...

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 1

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

más de 10 años hace | 0

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

más de 10 años hace | 0

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

más de 10 años hace | 0

Cargar más