Answered
Where should I save my own app prefereces?
If you want to do that properly, the directory (on Windows post XP) where to save the preferences would be: fullfile(getenv...

10 years ago | 4

| accepted

Answered
Error when inserting data into database without toolbox
Why are you using a jdbc to odbc driver? It would only make sense if you were already familiar with the java sql api, which does...

10 years ago | 0

| accepted

Answered
How to read in specific File names?
Assuming your matrix is actually a *cell array* of char vectors, the easiest way in *R2016b* is to use the new string class: ...

10 years ago | 0

Answered
I'm having trouble making the elseif statements work with excel files. So if i type GoogleStock.xlsx, it gives me everything correctly, but if i type AppleStock.xlsx, it gives me a matrix erro
Please *do not post screenshots*. Instead copy and paste the code and error (and use the *{} Code* button to format it as such)....

10 years ago | 0

Answered
How can I convert a double to a data with the following features?
This would get you started: bindatalength = sprintf('%d', numel(waveform)*2); %length of binary data (2*numbers of points...

10 years ago | 1

| accepted

Answered
How to avoid this for loops to improve computation time
First issue: you've predeclared |segment_label_images| and |pixelCount| however, you don't predeclare the matrices in each cell ...

10 years ago | 0

| accepted

Answered
Maximum Length allowed in fopen/movefile??
fopen(['\\?\', yourpath]) may work for you. Though as dpb says, such long paths would be better avoided as some tools (...

10 years ago | 0

Answered
Padding up to the length of a multiple of 3
For a row vector: v = 1:randi(50) %demo vector of random size paddedv = [v, zeros(1, mod(-numel(v), 3))] %pad v with 0s...

10 years ago | 1

| accepted

Answered
Error message. Increase font size.
h = errordlg('Error! Error!'); htext = findobj(h, 'Type', 'Text'); %find text control in dialog htext.FontSize = 15; ...

10 years ago | 0

| accepted

Answered
How to create a symmetrical matrix?
One of the many ways to do this: v = [1 2 3 4; 0 5 6 7; 0 0 8 9; 0 0 0 10]; tv = v'; v(tril(true(size(v)))) = tv(tril...

10 years ago | 3

Answered
how to code inverse of cosine in matlab? because i want to multiply it with 0.245.I have tried such codes like arccos,cosd and i cant get correct values by cross check with scientific calculator and got correct value too.But i need to know in matlab.
You know that matlab comes with documentation, right? How about looking it up in the doc under <https://www.mathworks.com/help/m...

10 years ago | 2

| accepted

Answered
Import of different sized spreadsheets
Note, these lines: Angle_1_=cell2mat(Angle_1); %cell->double Distance_1_=cell2mat...

10 years ago | 1

| accepted

Answered
How to sort vector with respect to another vector
What you're asking is simple indexing: A = [11; 12; 13; 21; 22; 31]; B = [5; 2; 1; 3; 4; 6] result = A(B)

10 years ago | 1

| accepted

Answered
Instantiations of custom classes *sometimes* unique, sometimes not. Bug?
I think you've already found the relevant documentation that explains what is happening. As to why it is like that, only Mathwor...

10 years ago | 2

| accepted

Answered
how to find the row wise maximum and minimum values of equal sized matrices in a cell array
Concatenate the matrices horizontally, get the max or min of this along the rows: a=[1 2 3;3 4 5]; b=[5 4 6;7 6 9]; c={a,b}...

10 years ago | 0

| accepted

Answered
How do you loop across rows of an array without overwriting calculated values?
The loop version: increment = 30; numblocks = ceil(size(A, 1)/increment); avg = zeros(numblocks, 1); for idx = 1 :...

10 years ago | 0

| accepted

Answered
How can I match rows from two tables by timestamp and create a new table?
Assuming R2016b, convert your tables to <https://www.mathworks.com/help/matlab/timetables.html Timetables> and use <https://www....

10 years ago | 1

Answered
in cody coursework i keep getting the response "Assertion failed." when i go to test the question. What am i doing wrong?
The assertion is telling you that your answer differs from the expected answer. That's all. Now, the reason may be that your ...

10 years ago | 1

| accepted

Answered
"Subscript indices must either be real positive integers or logicals" error from regula falsi function
I don't understand what you're trying to do with the statements |f(b) = fun(b)| and similar. This assigns the result of |fun| at...

10 years ago | 0

| accepted

Answered
How to write names of many files in single excel file along with its folder name?
Assuming you're using R2016b, where |dir| supports recursing into folder these 4 lines are all you need: projectdir = 'D:\m...

10 years ago | 0

| accepted

Answered
can anybody see a fault in my code, says there is error in InitialMoles(j,jj)
What I don't understand is why you can't see the problem: InitialMoles(NumberConstVols, NumberComponents) = 0; This init...

10 years ago | 0

Answered
How to find all nested functions in a program?
You can find nested (and local) functions that matlab thinks are unused with <https://www.mathworks.com/help/releases/R2016b/mat...

10 years ago | 0

Answered
hello, any one help me, i want to find the fastest way to solve the next problem:
Do not name your variable |cellstr| as it's also a matlab function. There are many, many ways to achieve what you want. One w...

10 years ago | 2

| accepted

Answered
build a origin destination matrix from 3 vectors without using vec2mat funct
I don't really understand your explanation as I don't see how |vec2mat| would be used for what you want, but given your input th...

10 years ago | 1

| accepted

Answered
Automatically creating an array of variables and assigning to a function with changing number of outputs
You don't need to use |eval| to cope with varying number of outputs. Use cell arrays and their implicit conversion to comma-sepa...

10 years ago | 1

| accepted

Answered
Compare two matrices and obtain points in common
Not sure what your question is. The only issue I see with the code you've posted is that |ib| should be used to index |XYZ| (or ...

10 years ago | 0

| accepted

Answered
Ismembertol command calculating average between two matched rows
Note: you made a mistake in your example, it should be: a = [A(ia, :), B(ib, 3)] %ib to index into b, not ia. To get th...

10 years ago | 1

| accepted

Answered
calculating the average from a large excel file
>>588845/48 ans = 12267.604 The number of rows is not divisible by 48. What are you planning to do with the last f...

10 years ago | 0

| accepted

Answered
special case of permutation combination with same sequence
What you want is not clear. Possibly, it is this: fullset = 1:30; currentset = [4 5 6]; setperms = arrayfun(@(n) perm...

10 years ago | 0

Answered
Strings cannot be compared
You seem to sort of know that you need to use |strcmp| for comparing string since you've put a (useless in this case) |strcmp| i...

10 years ago | 0

Load more