Answered
reading part of a very large txt file
Then read the file line by line until you find your pattern, then read the section you need until the next block of xy. Somethin...

8 years ago | 0

| accepted

Answered
Add newer data to older data without repetition
C = union(A, B, 'rows'); Note that your example is neither a <https://www.mathworks.com/help/matlab/ref/timeseries-class.ht...

8 years ago | 2

| accepted

Answered
How to extract certain Excel columns?
Using |readtable| is indeed the right way to do it. By default, |readtable| should read the first row as variable names. If it d...

8 years ago | 0

Answered
Replace String Value in Cell with Numerical Value
Identifying the char elements is easy. And once the rule for replacing them by numbers is known, replacing them is also easy: ...

8 years ago | 1

Answered
How can I save ALL workspace variables?
Loading the mat files efficiently so that you know what the variables within the files are is very easy if you follow the advice...

8 years ago | 0

Answered
Am new to Matlab.if i use imshow funtion,matlab shows error in the built in function..how can i overcome this problem?
Now that we've got the full error message, it's clear what the problem is. Rename your |image.m| script to something else. |i...

8 years ago | 1

Answered
Input arguments must be 'double'
If |x| is an |audiorecorder| object it's no wonder you get this error. You need to use the object to actually record and then ge...

8 years ago | 1

| accepted

Answered
Problem with the function mean - mean(x,'omitnan)
According to the <https://www.mathworks.com/help/matlab/release-notes.html?rntext=mean&startrelease=R2013b&endrelease=R2017b&gro...

8 years ago | 1

| accepted

Answered
binary vector function and hide image function erorr
Your screenshot in your comment to Jan's answer shows the complete error message. You removed the most important part of it in y...

8 years ago | 0

Answered
How can I delete certain rows of a matrix based on specific column value?
Assuming that what you have is a structure array with at least two fields, x and fit, and that for these structure elements whic...

8 years ago | 0

| accepted

Answered
How to modify "find" code to make it work for three data files?
As Jos says in his comment, most of your code is rather meaningless. In fact, if one was to be picky, one could find a fault wit...

8 years ago | 1

| accepted

Answered
How to get cumsum to work on consecutive values and restart if there is a 0 value?
There is no built-in function for this. I think there may be one on the <https://uk.mathworks.com/matlabcentral/fileexchange/?s_...

8 years ago | 1

Answered
I am upgrading to 2016B from 2013b, do I need a new license file?
If you have an active <https://uk.mathworks.com/services/maintenance.html Software Maintenance Service> on your license, then yo...

8 years ago | 0

Answered
Actxserver reading only first file
Have you verified that |get_files| actually contains more than one element. Is your listbox multiselect? There is nothing wro...

8 years ago | 1

| accepted

Answered
Looking for code generation in 2017b MATLAB version
The issue is not the version, it's either that you haven't installed the required toolbox, or more likely that your license does...

8 years ago | 0

Answered
How I use fprintf to acess a struct?
Numbering variables or structure fields is a bad idea. Any time you start naming things sequentially you need to think of using ...

8 years ago | 0

| accepted

Answered
Preallocating a complex structure
The code you wrote *does* preallocate the structure, with the correct size though probably by mistake. It also unnecessarily pre...

8 years ago | 0

Answered
vectorize a function that calls the itterator (condition in a loop)
You don't use any |if| for that. You get the result as a logical array and use that logical array as a mask: A = ones(size(...

8 years ago | 1

Answered
How to extract complete rows of data from a matrix based on the intersection of a matrix with different column dimensions
[isinA, whichArows] = ismember(B(:, [1 2]), A(:, [1 2]), 'rows'); filteredB = B(isinA, :); %I assume this is the output yo...

8 years ago | 1

| accepted

Answered
Calculate the duration of consecutive period and make an average of a vector related to this period
So if I understood correctly, A new storm starts when the difference between consecutive sample time is more than 3 hours. ...

8 years ago | 0

| accepted

Answered
How to apply a 3*3 mask for an image?
There are plenty of functions for <https://www.mathworks.com/help/images/neighborhood-and-block-processing.html neighbourhood an...

8 years ago | 0

Answered
Using string compare on imported data
If |ImpD| is a string array with a least four columns: ismatch = ImpD(:, 4) == "RT" to find "RT" in the fourth column. ...

8 years ago | 1

| accepted

Answered
Lack of functionality in online version of R2017b?
Online matlab is necessarily limited in some ways compared to the desktop version since it runs inside a browser. All the limita...

8 years ago | 0

Answered
Hi every one, I am a little bit new in matlab I would like to generate directed random graph using Matlab. That is a random directed graph with n nodes . That is How to generate a random network with a certain number of nodes in Matlab
With so little information the only thing we can do is point you to <https://www.mathworks.com/help/matlab/ref/digraph.html |dig...

8 years ago | 0

| accepted

Answered
Is it possible to detect color of sheet tab with actxserver?
I'd use |Tab.Color| instead of |Tab.ColorIndex| otherwise you'd also have to query the actual palette used by excel. Complete...

8 years ago | 1

| accepted

Answered
How to filter rows?
%R2016b or later: tokeep = all(A(:, 1:4) == [1 2 3 4], 2) %earlier versions tokeep = all(bsxfun(@eq, A(:, 1:4), [1 ...

8 years ago | 3

Answered
Alternate method for constructing circular region mask from center positions and radii
%random matrix of centre and radius coordinates for demo: xyr = [randi(150, 10, 2) + 50, randi(20, 10, 1)]; masksize = [...

8 years ago | 0

Answered
How can I create a loop for the numbers which are parts of the file name that I'm using in fopen?
Use |sprintf| to build the filename: g = 1; %for example p = 0; %for example f = 1; %for example fid = fopen(sp...

8 years ago | 0

| accepted

Answered
rotate a tif image
_"Rotating the polygon whose vertices are known around its centroid."_ Not sure why a tif image was mentioned then. Assumi...

8 years ago | 0

| accepted

Answered
find the intensity of the color present in an image especially CYAN, MAGENTA, YELLOW
*Very important:* Images that you see on a computer screen use the RGB colour model. There is no definition of Cyan, Magenta and...

8 years ago | 1

| accepted

Load more