Answered

Fibonacci serie, can not calculate with big number

If you're trying to calculate numbers in the Fibonacci series, there is a MATLAB function for it: Fibonacci If this doesn't he...

Fibonacci serie, can not calculate with big number

If you're trying to calculate numbers in the Fibonacci series, there is a MATLAB function for it: Fibonacci If this doesn't he...

3 mois ago | 0

Answered

Save images every certain period

for imagenumber = 1:1000 if mod(imagenumber,10)==0 % Modulo filename = sprintf('Image%d.png',imagenumber); ...

Save images every certain period

for imagenumber = 1:1000 if mod(imagenumber,10)==0 % Modulo filename = sprintf('Image%d.png',imagenumber); ...

3 mois ago | 1

Answered

how can i solve such two problems in single script file and run them?

There are two ways you could construct your function, as a symbolic function using syms, or as an expression that operates on a ...

how can i solve such two problems in single script file and run them?

There are two ways you could construct your function, as a symbolic function using syms, or as an expression that operates on a ...

3 mois ago | 0

Answered

Import time and date text file

You could try using: fid = fopen('filename.txt'); string = textscan(fid,'%s','delimiter','\n'); % Read in lines of string to v...

Import time and date text file

You could try using: fid = fopen('filename.txt'); string = textscan(fid,'%s','delimiter','\n'); % Read in lines of string to v...

3 mois ago | 0

Answered

How to generate random points

R = randi([0 1], 1000); imshow(R); Is this what you're looking for?

How to generate random points

R = randi([0 1], 1000); imshow(R); Is this what you're looking for?

3 mois ago | 0

Answered

using meshgrid to create a mesh

I don't think you have to meshgrid(Z), instead your 12x12 Z matrix represents the height of the mesh plot at coordinates specifi...

using meshgrid to create a mesh

I don't think you have to meshgrid(Z), instead your 12x12 Z matrix represents the height of the mesh plot at coordinates specifi...

3 mois ago | 0

Answered

Losing precision when writing to Excel using xlswrite

It could be to do with the format of the excel cells. In excel you can increase the number of decimal places displayed. Otherwi...

Losing precision when writing to Excel using xlswrite

It could be to do with the format of the excel cells. In excel you can increase the number of decimal places displayed. Otherwi...

3 mois ago | 0

Answered

Cell array to matix

You could try using: M = {}; % Your cell N = cat(3,M{:}); % Concatenate matrices along 3rd dimension This will give you a sin...

Cell array to matix

You could try using: M = {}; % Your cell N = cat(3,M{:}); % Concatenate matrices along 3rd dimension This will give you a sin...

3 mois ago | 0

Answered

Finding the set of unique values for another set of unique values

This should do the trick: M = [ 1,2;1,3;1,2;2,4;2,4;2,5]; % Your matrix u = unique(M(:,1)); for x = 1:length(u) N{x} = u...

Finding the set of unique values for another set of unique values

This should do the trick: M = [ 1,2;1,3;1,2;2,4;2,4;2,5]; % Your matrix u = unique(M(:,1)); for x = 1:length(u) N{x} = u...

3 mois ago | 1

Answered

How can I change the spacing/number of ticks in a figure?

This link should help: yticks It says you can specify the ticks on the y-axis. In your case it would be done as follows: ytic...

How can I change the spacing/number of ticks in a figure?

This link should help: yticks It says you can specify the ticks on the y-axis. In your case it would be done as follows: ytic...

3 mois ago | 0

| accepted

Answered

What is the correct equation?

You have a variable t in your equation which is a vector. In order to multiply vectors in MATLAB you must use the syntax .*. In ...

What is the correct equation?

You have a variable t in your equation which is a vector. In order to multiply vectors in MATLAB you must use the syntax .*. In ...

3 mois ago | 0

| accepted

Answered

Having trouble creating a table

Make sure the variables you create your table with are column vectors. In this case I suspect your vectors are row vectors. Jus...

Having trouble creating a table

Make sure the variables you create your table with are column vectors. In this case I suspect your vectors are row vectors. Jus...

3 mois ago | 0

Answered

How I can i read all files in a folder

You can use sprintf(). for n = 1:20 filename = sprintf('speaker1_%03d.wav', n) end Then within the loop input filename into...

How I can i read all files in a folder

You can use sprintf(). for n = 1:20 filename = sprintf('speaker1_%03d.wav', n) end Then within the loop input filename into...

3 mois ago | 0

Answered

How can I index the edges of a matrix

I have interpreted your question to mean that for both matrices, you want the set all of the matrix, except the edge, to zero an...

How can I index the edges of a matrix

I have interpreted your question to mean that for both matrices, you want the set all of the matrix, except the edge, to zero an...

3 mois ago | 0

Answered

transform duration into some visible in the table

Duration just refers to the format of the data stored in each cell array. You could convert your cell to a table, which might h...

transform duration into some visible in the table

Duration just refers to the format of the data stored in each cell array. You could convert your cell to a table, which might h...

3 mois ago | 1

| accepted

Answered

XTick labels for bar plot of 2 data sets

You can modify the colour of individual bars in the bar chart using CData. This documentation explains it well: CData Here is...

XTick labels for bar plot of 2 data sets

You can modify the colour of individual bars in the bar chart using CData. This documentation explains it well: CData Here is...

3 mois ago | 0

Answered

How to implement this equation?

If is a tensor, you could represent it as a matrix. Then your code should look something like this: lamda = ones(1,n); b = s...

How to implement this equation?

If is a tensor, you could represent it as a matrix. Then your code should look something like this: lamda = ones(1,n); b = s...

3 mois ago | 0

| accepted

Answered

How to average 5 rows of a vector recursively?

V = 1:9445; % Your vector setsize = 5; for x = 1:length(V)/setsize Vnew(x) = mean(V((x-1)*setsize+1:x*setsize)) end I...

How to average 5 rows of a vector recursively?

V = 1:9445; % Your vector setsize = 5; for x = 1:length(V)/setsize Vnew(x) = mean(V((x-1)*setsize+1:x*setsize)) end I...

3 mois ago | 0

| accepted

Answered

How do I plot the surface plot and surface plot based on the equation and conditions below?

a = 15; b = 7.5; k = 4*100/pi; % Define constants. X = linspace(-5,5,101); [x,y] = meshgrid(X,X); % x and y range. n = ...

How do I plot the surface plot and surface plot based on the equation and conditions below?

a = 15; b = 7.5; k = 4*100/pi; % Define constants. X = linspace(-5,5,101); [x,y] = meshgrid(X,X); % x and y range. n = ...

3 mois ago | 1

| accepted

Answered

Attempting to write my data into a single CSV file.

I would create a table, using the MATLAB function T = table(response, reaction_time); and then simply writing the table to a c...

Attempting to write my data into a single CSV file.

I would create a table, using the MATLAB function T = table(response, reaction_time); and then simply writing the table to a c...

3 mois ago | 1

| accepted

Question

Solving PDEs: time dependent c coefficient

I am solving a PDE to simulate current flow through a conductive medium in 2D. My geometry is as follows: With Neumann bound...

3 mois ago | 1 answer | 1

Solved

Pascal's Triangle

Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

3 mois ago

Solved

Balanced number

Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

3 mois ago

Solved

Which values occur exactly three times?

Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

3 mois ago

Solved

Sort a list of complex numbers based on far they are from the origin.

Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

3 mois ago

Solved

What is the next step in Conway's Life?

Given a matrix A that represents the state of <http://en.wikipedia.org/wiki/Conway's_Game_of_Life Conway's game of Life> at one ...

3 mois ago

Solved

Binary numbers

Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

3 mois ago

Solved

Which doors are open?

There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

3 mois ago

Solved

Pangrams!

A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

3 mois ago

Solved

Target sorting

Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

3 mois ago