Answered
How to ignore not serializable variables when saving workspace
I get a warning not an error if I try to save a workspace with an non-serialisable java variable: >> socket = java.net.Datagram...

7 years ago | 1

Answered
Repeat operation and change values ​​of an array
As per Bob's comment, we have no idea what f and t are. Assuming they're constant, this is probably what you're after: P = ????...

7 years ago | 0

Answered
Efficient way to multiply an cell matrix with a scaler?
Since for your summation to succeed all the arrays in K11 must be the same size, convert that cell array to a 3D matrix. It will...

7 years ago | 0

| accepted

Answered
How to make an array of pointers to a subset of values in an existing array?
No, it's not possible at all. Matlab does not have pointers and there is no mechanism to access slices of a matrix (even read-on...

7 years ago | 0

| accepted

Answered
Is there any way to have an array which holds different function names?
Use a cell array in which you store function handles or anonymous functions: funarray = {@sin, @cos, @(v) v.^2}; %cell array c...

7 years ago | 1

Answered
How can I convert two channel 16-bit images to RGB 8-bit image?
You can't just do uint8(uint16imge). Any intensity from 256 to 65535 in the uint16 image would become 255 after the conversion. ...

7 years ago | 0

Answered
Command and Control vectors
A 'correct' version of your code, with all the pointless loops could be: t = [1, 2, 1, 2, 1, 3]; d = zeros(1, numel(t)*5); ...

7 years ago | 0

| accepted

Answered
How to populate csv rows, rather than columns? This program creates a csv file with each vectorized image in a column, but i want to know if it's possible to store each vectorized image as a row instead.
It seems trivial to resolve to me: Either tranpose your matrix when you write it: csvwrite('imgdata.csv', vector_imag'); Or ...

7 years ago | 0

| accepted

Answered
Reshape matrix adding columns of zeros at specific index
The simplest way to do what you want is to import the files as tables and let matlab do all the work of figuring out the format ...

7 years ago | 1

| accepted

Answered
How to join 2 MATLAB tables based on similarity in values of first column?
Your description is that of an innerjoin, not an outerjoin. It's unclear why any one of the join wouldn't work. You must be doin...

7 years ago | 1

| accepted

Answered
How to share attribue with several objects ?
I don't think you've grasped OOP yet. As Adam asked you need to explain what you're trying to do, with words, not code. As it i...

7 years ago | 0

Answered
From vector to matrix reshape every ith rows for each column
If you want to achieve what your code does instead of the result you show (see Stephen's comment): mat = reshape(arr, 3, []).' ...

7 years ago | 0

Answered
How to repeat rows in fields of structure
Note that practically, there is no difference between arrayfun, structfun, etc. and a loop. If anything, arrayfun can be slower ...

7 years ago | 1

| accepted

Answered
Anonymous functions behavior is weird
I don't think the problem stems from anonymous function per se. I believe that the root of what you're seeing is that the chaini...

7 years ago | 0

| accepted

Answered
Struct contents reference from a non-struct array object
You're using a global variable. We don't recommend using global variables as it's impossible to easily track what bit of code is...

7 years ago | 0

| accepted

Answered
xlsread in matlab app designer
You probably need to learn a bit more about class design in matlab. Indeed, the code you have written cannot be put in the prope...

7 years ago | 1

Answered
Hi guys how can I put my-string in input of matlab?
As per my comment, your double for loop to compute the histogram of the characters can be replaced by: my_string = '@**.. @'; ...

7 years ago | 0

Answered
save a data in excel
There are several puzzling things in the code you've written, which makes me think you don't fully understand what you're doing....

7 years ago | 0

Answered
sort the matrix according to order of column
Result = sortrows(A, [2 1]) %sort first by 2nd column, then by 1st

7 years ago | 0

| accepted

Answered
Matrix manipulation problem under MATLAB
Possibly, you're looking for blkdiag: A = [0 2 9; 5 7 3; 4 6 1]; C = [1 2 3; 4 5 6; 7 8 9]; B = blkdiag(A, C)

7 years ago | 0

Answered
How can i automate the following process for n times?
Never create numbered variables. It's a clear indication that you should be using an array, which can be easily indexed instead....

7 years ago | 1

| accepted

Answered
assign the same vector to be the same cell
Can be done easily with findgroups (or the older unique) and splitapply (or the older accumarray), in just one line: A = [1 2;1...

7 years ago | 0

Answered
Binary search algorithm- find the bit error position
If you want to know the location(s) of the error, you need to keep track of your pivot point (floor(n/2)) and return that togeth...

7 years ago | 0

| accepted

Answered
problem in imwrite new images into new directory
Note: when reporting an error always give us the full error message. In particular, you've removed the part that tells you which...

7 years ago | 0

| accepted

Answered
how to concatenate two audio files of different matrix dimensions?
You're missing the column indexing in your y1(q*10+1:end), therefore it's converted into a row vector, which will have a differe...

7 years ago | 0

| accepted

Answered
How can I convert high pass filtered image to grayscale image and save?
I've not tried to understand your code, but it appears to me that B2 is derived from I which is already a greyscale image. There...

7 years ago | 1

| accepted

Answered
Selecting rows from a table using a column that includes Nan elements
The real question is why have you got NaN in a column of text. It's never a good idea to mix text with numeric. The best thing w...

7 years ago | 0

| accepted

Answered
What are the extra subdirectories returned by dir function?
<rant mode on> They're absurd hold overs from a long gone era (DOS) where knowing that the current directory had a parent was so...

7 years ago | 5

Answered
can i run a .m file from my visual basic application (not excel)
On a computer that has matlab installed (and licensed), it's easy to call matlab functions from VB. See Matlab API for COM (COM ...

7 years ago | 0

| accepted

Answered
For loop causing an Infinite loop
There are only two loops in your code, one with length(T) steps, one with numel(F)-1 steps. These values are guaranteed to be fi...

7 years ago | 0

Load more