Answered
Changing names within a data
Dear Nora, you can do it the following way: ID = fopen('filename.txt'); a = textscan(ID, '%s%f%s%f'); fclose(ID); ...

12 years ago | 0

Answered
Using Power Iteration on a Large Matrix
Dear Alex, Of course MATLAB can handle it. The main problem comes not with MATLAB but with the processing capacity as well as me...

12 years ago | 1

| accepted

Answered
draw picture with ezplot
Dear xinyu, yes you can plot as follows: syms beta omega Lambda rho rho = Lambda * omega + beta; rho2 = subs(rho, [La...

12 years ago | 0

Answered
Matlab "too many output arguments"
Dear Gilmar, I wrote a sample function which takes 20 inputs and gives 4 outputs as below: function [w, x, y, z] = myfoo(x1...

12 years ago | 1

Answered
As I can solve the following problem binary
Dear FRANCISCO, here is the code which performs the desired function: s = 1:100; % Your array n = 11; % Length of sub-ar...

12 years ago | 0

| accepted

Answered
I take 4x4 blocks from the Gray image , filtered it and now i want to return it back to the original gray .
Dear Zgrt, you can do it the following way: gray3=dct2(gray2); gray4=gray3(1:4,1:4); IDCT_Gray=idct2(gray4); h = f...

12 years ago | 1

| accepted

Answered
midpoint rule for integration
Dear Joe, re-write f as follows: f = @(x) (x.^3-1).^(1/2); Then code should work. I hope it helps. Good luck!

12 years ago | 2

Answered
Can I create an array of matricies?
Dear James. you dont need loop for this you can do it like this: array1 = rand(10, 1); array2 = rand(10, 1) * 2; ar...

12 years ago | 0

| accepted

Answered
How to calculate fourier coefficients in Matlab
Dear Javid, here is the code for your problem: A = input('Enter value of A:'); B = input('Enter value of B:'); D = in...

12 years ago | 0

| accepted

Answered
Attempted to access dz(1,1000); index out of bounds because numel(dz)=1.
Dear Alex, here is your working code, I made some modifications(If i understood correctly what you want to do): k = 0.5; ...

12 years ago | 0

Answered
Problem with a program concerning composite trapezoid rule
Dear Drake, re-write first line as: f = @(x) 1./(1+x.^2); then it should work. Good luck!

12 years ago | 0

| accepted

Answered
How to make for loop ?
Dear Negar, try this: for j = 1:length(files) [signal,Fs,nbits,opts] = wavread(strcat('database/ae/ae_0a0', num2str(...

12 years ago | 0

| accepted

Answered
How can i compress this code into some form of loop so that it is not so bulky?!
Dear Joel, you can make this code compact in the following way: s = 2; syms n i = 1:4; f = n.^i; fprime = i .* ...

12 years ago | 0

Answered
Having trouble implementing a function
It means you should input all four values for "f,tspan,y0,N" because your "euler" function has four inputs

12 years ago | 0

| accepted

Answered
Is there a way to disconnect lines between data points while utilizing the plot function?
Dear Brad, you can do it the following way: x = [1;2;3;4;5;6;7;8;9]; y = [10;20;30;40;50;60;70;80;90]; plot(x(1...

12 years ago | 0

| accepted

Answered
Loop not working? How can i save the total values wth out getting overwrite in the save file?
Dear Uday, you don't need loop in this case. You can do what you need directly as follows: a=input ('what is the a value?')...

12 years ago | 1

Answered
how do I plot one channel of data when I have 100 channels?
Here is the code for this: select_channel = 10; % select channel you want to plot M = rand(100, 300); % It is matrix which...

12 years ago | 0

Answered
Unable to run symbolic script, MATLAB is making fractions extremely large and unable to handle them
Dear Amit, here is the modified code: tic syms x1 x2 x3 a; f = x1^2+2*x2^2+2*x3^2+2*x1*x2+2*x2*x3; p=[1,1,1]; n...

12 years ago | 1

| accepted

Answered
How do I plot this sine wave?
Dear Niamh, you can do the following way: time = -1:0.01:1; frequency = 97; phase = 97; phase_in_rad = degtorad(ph...

12 years ago | 1

| accepted

Answered
from 8760 x 1 to 1 x 8760 ??
Dear you can do like this(if i understood correctly): num = xlsread('filename.xls', 'A:A'); ind = 1:length(num); matr...

12 years ago | 0

Answered
store the value in the variable
you can do like this: p = C(1,:) q = C(2,:) Or if you want to use for loop then you can do like this: p = zeros(...

12 years ago | 0

| accepted

Answered
How do I split a color image into its 3 RGB channels?
If you want to show RGB channels in there original color then you can do like it: img = imread('filename.png'); % Read imag...

12 years ago | 11

Answered
Writing zero to text file
Dear Andrew, you can write the 0s in the text file in the following way: a = {'0.00000', '0.00000', '0.000000'}; ID = fo...

12 years ago | 0

Answered
Problem with symbolic math
Dear Amit, it is working fine: syms x1 x2 x3 gr = [2*x1 + 2*x2; 2*x1 + 4*x2 + 2*x3; 2*x2 + 4*x3]; p1 = [957/2500; -29...

12 years ago | 0

Answered
How to extract a part of a given vector and store it in a new vector using loops (for loop) ?
Dear Abhisek, here is the code for it: a = [1 2 3 4 5 6 7 8 9 10]; indices_of_values2save = [4 5 6 7]; count = 1; ...

12 years ago | 0

| accepted

Answered
How to declare function?
Dear Mustafa, function y = calculate_sqrt(x) y = x .* (sqrt(x) - sqrt(x - 1)); end you can save it with th...

12 years ago | 0

| accepted

Answered
Time to run programming
Yes you can use tic your code... toc See: <http://www.mathworks.de/de/help/matlab/ref/tic.html> and <http:/...

12 years ago | 0

Answered
r g b components of an image
Dear Shefali, one way to just show three separate color images is as follows: img = imread('filename'); figure, imshow...

12 years ago | 5

Answered
num2str not working for me
Dear Chris, you don't need to use num2str function in order to achieve your goal. You can solve this equation and also able to c...

12 years ago | 0

Answered
Write a function that produces a plot for the Cantor Set
Dear Jerry, here is the code which plotting Cantor Set: n = input('Input number of iterations:'); a = cell(1,n); for j = ...

12 years ago | 0

| accepted

Load more