How to read complex number from a *.csv file?
you can do it as follows: [num, str, raw] = xlsread('filename.csv'); a = str2num(cell2mat(raw));

10 years ago | 0

find a Nan in column of cell array and delete the row
here is an example which can give you idea how you can do it: a = rand(1152, 4); a(randi(1152, 1, 20), :) = NaN; a = ...

10 years ago | 1

you can do it as follows: a = randi(100, 20, 1); b = []; for i = 1:20 b = [b, a]; a = circshift(a, 1); ...

10 years ago | 0

| accepted

how to save a cell array to csv file
I basically can't understand you full question because it is in other language. So I can show you a way that you can try to save...

10 years ago | 0

Need some improvement in the plotting values
Dear Stefan, try this: count = 1; k2 = 0; for i=1:500:4500 if (i<3900) k1 = a(i:i+499,1); ...

10 years ago | 0

how can I draw this loop ?
try this: a = [48 52 58 73 85 103 135 193 80 42 2 -18 -29 -40 -45 -48]; b = [0 0.2 0.4 0.6 0.7 0.8 0.9 1 0.95 0.9 0.8 0....

10 years ago | 0

| accepted

I want my code to run continuously.
try to run code again and again it will give you different values from 1 to 3 each time

10 years ago | 0

How can I implement a simple difference equation and plot the resulting output, all using MATLAB
may be you can try something like this: N = 500; for n = 1:N xValues = sum(randi(10, 1, n) .* (rand(1, n) - 1)); ...

10 years ago | 0

M-file for exercise!!!
If you want to re-use some operation again and again then function is better and if you just wanted to start writing codes in MA...

10 years ago | 0

How can I plot an image in matlab. This is giving me a Black png image!
you can do it as follows: URL ='http://structures.wishartlab.com/molecules/HMDB00126/image.png' filename = 'test.png' ...

10 years ago | 0

| accepted

issue in matrix multiplication
mary you can get desired output as follows: G = [1 1 1 1 1 0 0 0 1 0 0 0; 0 0 1 1 0 0 0 1 0 1 0 0; 1 1 1 0 1 0 0 1 0 0 1 0;...

10 years ago | 0

Subscript indices must either be real positive integers or logicals.
replace line 36 with the following line: z= -t * (8.314 / ( v - 0.1251897785e-3) + (.1209032931 * (1.858281421 - 0.37270464...

10 years ago | 0

| accepted

How can I add both numbers and text as legend in a plot?
use legend(strcat('Some text', num2str(someValue)))

10 years ago | 12

| accepted

Plotting data from a .csv file
you can do it as follows: Array=csvread('filename.csv'); col1 = Array(:, 1); col2 = Array(:, 2); plot(col1, col2)

10 years ago | 4

| accepted

Does my 3D surface plot look ok?
may be you can make it look better like this: [X, Y] = meshgrid (-50:0.5:50, 0:0.5:30); TEST1TEMP = X * 9/5 + 32; TES...

10 years ago | 0

| accepted

How can i create a multivariable function from matrix data?
if you have symbolic toolbox installed then you can do it as follows: A = [150; 200; 300]; p = sym('p%d', [1 numel(A)])...

10 years ago | 0

| accepted

Averaging brightness/fluorescent intensity in columns (y axis)
just use meanAlongEachColumn = mean(grayImage) it will create an array of mean values. Each value in this row vector wil...

10 years ago | 0

| accepted

error : Function integration trapezoidal

10 years ago | 0

| accepted

Multiple Labels in an Image
you can store labels for all of your items in a cell array of strings and then you can use this cell array of strings in place o...

10 years ago | 1

| accepted

How to use a fzero function and subfunctions?
Your code is working but its not giving correct ans because of your initial condition: %Parameters T=250; Tb=340; ...

10 years ago | 0

How to display a polynomial?
you can do something like this: fprintf('(%d) * x^2 + (%d) * x + %d\n', a, b, c)

10 years ago | 2

| accepted

Writing a code to find area of polygon
If you have coordinates of the corners in the form of (x1, y1) and (x2, y2) format and also if you like to calculate the area of...

10 years ago | 0

Rescale an axis in other steps without creating vector
Try this: y = rand(1, 1000); % your data x = linspace(0, 20, numel(y)); % your time series plot(x, y) % your plot of...

10 years ago | 0

How to get 10 day averaged time series of following time series, which is a time series from 2004-2011. I need 10 dat averaged time series from 2004-2011 in every column. Following is the time series which is day to day time series
Dear Chris Martin, maybe you can try something like this(depending upon your data you will have to make modifications accordingl...

10 years ago | 0

Rescale an axis in other steps without creating vector
You can control your x-axis by plotting your data against your time as follows: y = rand(1, 1000); % your data x = linsp...

10 years ago | 0

Replicating values a certain number of times
try this: x = 1:100; % Values to be repeated a = 4; % Number of times each value is repeated b = repmat(x, 4); b =...

10 years ago | 1

ploting a signal which has different frequency
Dear Faranak, do you need something like this: x = 0:0.01:2 * pi; count = 0; for i = 5:-1:1 y = sin(i * x); ...

10 years ago | 0

Finding a character in a string?
Dear Johny, try this: hashtag=lower(input('Which hashtag would you like information on?','s')); if isempty(strfind(hasht...

10 years ago | 0