Answered
Find number of zeros in a part of a matrix
A = [1 2 2 2 2 2 0 2 2 2 0 3 0 0 4 5 6 7 0 0 8]; numZeros = sum(~A(5:10));

13 years ago | 1

Answered
How to repopulate popupmenu by deleting old data.
set(popup_handle,'String','') That should do the trick.

13 years ago | 0

Answered
how to print output in gui
You could create a editbox in a figure and display the value there: Example: fh = figure; prompt = {1 3}; eh = uic...

13 years ago | 0

| accepted

Solved


Free passes for everyone!
_Simply return the name of the coolest numerical computation software ever_ *Extra reward* (get a _freepass_): As an addit...

13 years ago

Answered
Problem with a matlab question
There are multiple ways you can do this. The first involves a *for loop* and, while it might require more lines of code, is prob...

13 years ago | 0

| accepted

Answered
importdata vs xlsread to read an excel file
If you want to find out, try timing the operation of each function: tic; xlsread('my_file.xlsx'); toc tic; importdat...

13 years ago | 3

| accepted

Solved


normalize group of numbers to integers
Hi guys! I have a group of 4 numbers x,y,z,w which comes from 4 integers multiplied with a common factor. [x,y,z,w] = c [i,j,k,...

13 years ago

Answered
How can I keep figure boxes from popping up while running script.
Are you wanting to save the plot created on each pass of your loop? If so, just move the figure creation line out of the loop. A...

13 years ago | 0

| accepted

Solved


Finding peaks
Find the peak values in the signal. The peak value is defined as the local maxima. For example, x= [1 12 3 2 7 0 3 1 19 7]; ...

13 years ago

Solved


Make a Star Pyramid
Create a star pyramid. First line will have 1 star, second will have two stars and so on... a basic program which is easily done...

13 years ago

Solved


Accessing elements on the diagonal
Access the diagonal elements of a matrix without 'diag' function

13 years ago

Solved


Find the Kronecker Tensor Product without using KRON
The Kronecker Tensor Product is the result of multiplying all elements of a matrix with each of the elements of another matrix. ...

13 years ago

Solved


Transposition as a CIPHER
This all about transcripting a text message. If the input string is: *s1 = 'My name is Sourav Mondal'*, then the output is: *s2...

13 years ago

Solved


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

13 years ago

Solved


Use of regexp
* Given a string, containing several sentences, such as: * 'I played piano. John played football. Anita went home. Are you safe...

13 years ago

Answered
how can i add noise to the image??
Do you have the image processing toolbox? If so, you might find *imnoise* useful. http://www.mathworks.com/help/images/ref/im...

13 years ago | 0

Solved


exactly?
given two strings of numeric expressions such as '1-7/14' and '11/22+0.2^2', return 1 if they are numerically exactly equal othe...

13 years ago

Answered
Can a function inside a parent code access the full workspace of that parent code?
A nested function can access the variables stored in the workspace of its caller function: function x = outer_function(a,b)...

13 years ago | 1

| accepted

Solved


Make a diamond
Given n, odd number > 1, return n by n matrix consist of "null" and "*" characters arranged like a diamond. No toolbox funct...

13 years ago

Answered
How to include a conditional function inside a "for k = 1 : 200" loop?
Yes, you need to pass the k value, and any other values used from the calling function, into your function that you call within ...

13 years ago | 1

| accepted

Answered
how can store string and number in a matrix?
You can use a cell array for storing values of differing datatypes: A = {'matlab' 'ver' 12} You can also use a cell array ...

13 years ago | 0

Solved


Create incrementing array
Given a and b generate an output matrix as shown in following examples: a=2 b=5 output=[2 20 200 2000 20000] a=4 b...

13 years ago

Answered
Is it possible to configure data in a excel file from matlab? If so, How can I do it?
Do you want the timestamp (22:57:13) to be split into separate rows or placed all in the same column? Either way, a combinati...

13 years ago | 0

Answered
Need help inproveing function...
Does this do what you want? >> x = [1 1 3 5 4 6 6 1 9 1 1 8 2 5 5 5 2 7 7 2 2 2]; >> idx = cumsum([1 diff(x) ~= 0]); ...

13 years ago | 0

| accepted

Answered
How to open an axes object inside a GUI ?
If you're asking if this sort of functionality is available without doing your own coding when interacting with axes in figure w...

13 years ago | 1

| accepted

Answered
export output from a linear regression to Excel
You could store your data in a cell array where the first row of elements are the headings (coefficients, r^2, etc.). Then that ...

13 years ago | 0

| accepted

Answered
when using genetic algorithm, the number of variables(nvar) is dependant on the row vector(x) that my fitness function accepts. How can I deal with that?
Have you looked into the *varargin* function? help varargin You could then parse the arguments contained within varargin...

13 years ago | 0

Solved


Prime Time
All you need to do here is submit your solution a prime number of seconds after the top of the hour. Any hour at all... Easy, ...

13 years ago

Solved


Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

13 years ago

Solved


Project Euler: Problem 4, Palindromic numbers
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 ...

13 years ago

Load more